public void SetUp() { dateTimeMock = new DynamicMock(typeof(DateTimeProvider)); dateTimeMock.SetupResult("Today", new DateTime(2005, 7, 20, 0, 0, 0, 0)); labeller = new IterationLabeller((DateTimeProvider)dateTimeMock.MockInstance); labeller.ReleaseStartDate = releaseStartDate; }
public void SetUp() { dateTimeMock = new Mock <DateTimeProvider>(); dateTimeMock.SetupGet(provider => provider.Today).Returns(new DateTime(2005, 7, 20, 0, 0, 0, 0)); labeller = new IterationLabeller((DateTimeProvider)dateTimeMock.Object); labeller.ReleaseStartDate = releaseStartDate; }
public void PopulateFromConfiguration() { string xml = string.Format(@"<iterationlabeller incrementOnFailure=""true"" duration=""1"" releaseStartDate=""{0}"" prefix=""foo"" separator=""-"" />", releaseStartDate); labeller = (IterationLabeller)NetReflector.Read(xml); Assert.AreEqual(true, labeller.IncrementOnFailed); Assert.AreEqual(1, labeller.Duration); Assert.AreEqual("foo", labeller.LabelPrefix); Assert.AreEqual("-", labeller.Separator); Assert.AreEqual(releaseStartDate, labeller.ReleaseStartDate); }
public void IterationLabellerSerializerTest( ) { Serializer <IterationLabeller> ser = new Serializer <IterationLabeller> ( ); IterationLabeller il = new IterationLabeller( ); il.Duration = 1; il.Prefix = "1.0"; il.Separator = "."; il.ReleaseStartDate = DateTime.Now.AddDays(-25); XmlElement ele = ser.Serialize(il); Assert.IsNotNull(ele); Console.WriteLine(ele.OuterXml); }