using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using DateTimeUtlities; using System.Fakes; using Microsoft.QualityTools.Testing.Fakes; namespace YearUtilitiesTest { [TestClass] public class UnitTest1 { [TestMethod] public void TestForLastDay() { //Arrange YearUtilities yearUtilities = new YearUtilities(); //Act bool CurrenrResult = false; using (ShimsContext.Create()) { ShimDateTime.NowGet = () => new DateTime(2012, 12,31); CurrenrResult =yearUtilities.IsTodayLastDateOfYear(); } //Assert Assert.AreEqual<bool>(true, CurrenrResult); } [TestMethod] public void TestForNotLastDay() { //Arrange YearUtilities yearUtilities = new YearUtilities(); //Act bool CurrenrResult = false; using (ShimsContext.Create()) { ShimDateTime.NowGet = () => new DateTime(2012, 12,15); CurrenrResult = yearUtilities.IsTodayLastDateOfYear(); } //Assert Assert.AreEqual<bool>(false, CurrenrResult); } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)