public void VersionUnit_DefaultsToIncrementWithNumber() { var sut = new VersionUnit("1"); Assert.Equal("1", sut.Value); //, "The value should default correctly"); Assert.Equal(VersionIncrementBehaviour.Fixed, sut.Behaviour); }
public void ChangeBehaviour_OnceSet_Exception() { var sut = new VersionUnit("1"); sut.SetBehaviour(VersionIncrementBehaviour.AutoIncrementWithReset); Assert.Throws <InvalidOperationException>(() => { sut.Value = "Bannana"; }); }
public void VersionUnit_ChangeBehavour_ExceptionIfNotIncrementable() { Bilge.Log(nameof(VersionUnit_ChangeBehavour_ExceptionIfNotIncrementable) + " Entered"); var sut = new VersionUnit("monkey"); Assert.Throws <InvalidOperationException>(() => { sut.SetBehaviour(VersionIncrementBehaviour.AutoIncrementWithReset); }); }
public void VersionUnit_ChangeBehaviour_ExceptionIfNotIncrimentable() { b.Info.Flow(); Assert.Throws <InvalidOperationException>(() => { var sut = new VersionUnit("monkey"); sut.SetBehaviour(DigitIncremementBehaviour.AutoIncrementWithReset); }); }
public void Increment_OverrideReplacesIncrement() { var vu = new VersionUnit("1", "", DigitIncremementBehaviour.ContinualIncrement); vu.IncrementOverride = "9"; var sut = new CompleteVersion(vu); sut.Increment(); Assert.Equal("9", sut.GetVersionString(DisplayType.Full)); //, "The overide on a word value did not work"); }
public void SimpleIncrement_Incrment_Works() { var vu = new VersionUnit("2", "."); vu.SetBehaviour(DigitIncremementBehaviour.AutoIncrementWithReset); var sut = new CompleteVersion(new VersionUnit("1"), vu); sut.Increment(); Assert.Equal("1.3", sut.ToString()); //, "The verison increment should do nothing for fixed"); }
public void SimpleIncrement_Incrment_Works() { var vu = new VersionUnit("2", "."); vu.SetBehaviour(VersionIncrementBehaviour.AutoIncrementWithReset); var sut = new CompleteVersion(new VersionUnit("1"), vu); sut.PerformIncrement(); Assert.Equal("1.3", sut.ToString()); }
public void Increment_OverrideReplacesIncrement() { var vu = new VersionUnit("1", "", VersionIncrementBehaviour.ContinualIncrement); vu.IncrementOverride = "9"; var sut = new CompleteVersion(vu); sut.PerformIncrement(); Assert.Equal("9", sut.GetVersionString(DisplayType.Full)); }
public void Override_NoIncrement_DoesNotChangeValue() { var vu = new VersionUnit("1"); vu.Value = "Monkey"; vu.IncrementOverride = "Fish"; var sut = new CompleteVersion(vu); Assert.Equal("Monkey", sut.GetVersionString(DisplayType.Full)); }
public void Increment_OverrideWorksOnFixed() { var vu = new VersionUnit("1", "", VersionIncrementBehaviour.Fixed); vu.IncrementOverride = "Fish"; var sut = new CompleteVersion(vu); sut.PerformIncrement(); Assert.Equal("Fish", sut.GetVersionString(DisplayType.Full)); //, "The overide on a word value did not work"); }
public void Increment_OverrideWorksOnFixed() { var vu = new VersionUnit("1", "", DigitIncremementBehaviour.Fixed); vu.IncrementOverride = "Fish"; var sut = new CompleteVersion(vu); sut.Increment(); Assert.Equal("Fish", sut.GetVersionString(DisplayType.Full)); }
public void Increment_OverrideWorksForNumbers() { var vu = new VersionUnit("1"); vu.IncrementOverride = "5"; var sut = new CompleteVersion(vu); sut.Increment(); Assert.Equal("5", sut.GetVersionString(DisplayType.Full)); }
public void Increment_OverrideWorksForNames() { var vu = new VersionUnit("Monkey"); vu.IncrementOverride = "Fish"; var sut = new CompleteVersion(vu); sut.Increment(); Assert.Equal("Fish", sut.GetVersionString(DisplayType.Full)); //, "The overide on a word value did not work"); }
public void Increment_ResentAnyWorks() { var vu2 = new VersionUnit("0", "."); var sut = new CompleteVersion( new VersionUnit("1", ""), vu2, new VersionUnit("1", "."), new VersionUnit("0", ".", DigitIncremementBehaviour.AutoIncrementWithResetAny)); Assert.Equal("1.0.1.0", sut.GetVersionString()); //, "Without an increment its wrong - invalid test"); sut.Increment(); Assert.Equal("1.0.1.1", sut.GetVersionString()); //, "Increment on all fixed should not change anything"); vu2.IncrementOverride = "5"; sut.Increment(); Assert.Equal("1.5.1.0", sut.GetVersionString()); //, "The final digit should reset when a fixed digit changes."); }
public void VersionUnit_DefaultPostfix_IsCorrect() { var sut = new VersionUnit("1"); Assert.Equal("", sut.PreFix); //, "The default prefix is blank"); }
public void VersionUnit_DefaultPostfix_IsCorrect() { var sut = new VersionUnit("1"); Assert.Equal("", sut.PreFix); }
public void DefaultBehaviour_IsFixed() { var vu = new VersionUnit("2", "."); Assert.Equal(VersionIncrementBehaviour.Fixed, vu.Behaviour); }
public void SetBehaviour_OnConstructor_Works() { var vu = new VersionUnit("2", ".", VersionIncrementBehaviour.AutoIncrementWithReset); Assert.Equal(VersionIncrementBehaviour.AutoIncrementWithReset, vu.Behaviour); }
public void VersionUnit_NonDigit_WorksFine() { var sut = new VersionUnit("monkey"); Assert.Equal("monkey", sut.Value); //, "The value was not set correctly"); }
public void VersionUnit_FirstParamIsTheDigit() { var sut = new VersionUnit("1"); Assert.Equal("1", sut.Value); //, "The value isnt set in the constructor"); }
public void Prefix_IsPrefixWhenSpecified() { var sut = new VersionUnit("5", "Monkey"); Assert.Equal("Monkey5", sut.ToString()); //, "The prefix was not correctly specified in the ToSTring method"); }
public void VersionUnit_SecondParameterChangesPostfix() { var sut = new VersionUnit("1", "X"); Assert.Equal("X", sut.PreFix); //, "The prefix needs to be set by the constructor"); }
public void VersionUnit_FirstParamIsTheDigit() { var sut = new VersionUnit("1"); Assert.Equal("1", sut.Value); }