public void UnitTestGenerateForFirstBuildOfTheDay() { using (this.mocks.Record()) { Expect.Call(this.mockIntegrationResult.Label).Return("1.0.0.0"); LastCall.Repeat.Once(); Expect.Call(this.mockIntegrationResult.Label).Return("1.0.0.0"); LastCall.Repeat.Once(); } DateVersionLabeller dateVersionLabeller = new DateVersionLabeller(); dateVersionLabeller.MajorVersionNumber = 1; dateVersionLabeller.MinorVersionNumber = 0; string label; using (this.mocks.Playback()) { label = dateVersionLabeller.Generate(this.mockIntegrationResult); } string expected = GetLabelForToday(1, 0, 0); Assert.AreEqual(expected, label, "The Label returned was not as expected."); this.mocks.VerifyAll(); }
public void UnitTestGenerateWithInvalidPreviousLabel() { using (this.mocks.Record()) { Expect.Call(this.mockIntegrationResult.Label).Return("1"); LastCall.Repeat.Once(); Expect.Call(this.mockIntegrationResult.Label).Return("1"); LastCall.Repeat.Once(); } DateVersionLabeller dateVersionLabeller = new DateVersionLabeller(); dateVersionLabeller.MajorVersionNumber = 1; dateVersionLabeller.MinorVersionNumber = 0; using (this.mocks.Playback()) { dateVersionLabeller.Generate(this.mockIntegrationResult); } this.mocks.VerifyAll(); }
public void UnitTestGenerateWithInvalidPreviousLabelAndInitialise() { DateVersionLabeller dateVersionLabeller = new DateVersionLabeller(); dateVersionLabeller.MajorVersionNumber = 1; dateVersionLabeller.MinorVersionNumber = 0; dateVersionLabeller.Initialise = true; using (this.mocks.Record()) { Expect.Call(this.mockIntegrationResult.Label).Return("1"); LastCall.Repeat.Once(); Expect.Call(this.mockIntegrationResult.Label).Return("1"); LastCall.Repeat.Once(); } string label; using (this.mocks.Playback()) { label = dateVersionLabeller.Generate(this.mockIntegrationResult); } string expected = GetLabelForToday(1, 0, 0); Assert.AreEqual(expected, label, "The Label returned was not as expected."); this.mocks.VerifyAll(); }
public void UnitTestGenerateWithArgumentNull() { DateVersionLabeller dateVersionLabeller = new DateVersionLabeller(); dateVersionLabeller.MajorVersionNumber = 1; dateVersionLabeller.MinorVersionNumber = 0; dateVersionLabeller.Generate(null); }