public void UseCase_PliskyFileTypes_Works() { var sut = new CompleteVersion(new VersionUnit("2"), new VersionUnit("0", "."), new VersionUnit("Unicorn", "-"), new VersionUnit("0", ".", VersionIncrementBehaviour.ContinualIncrement)); var fut4 = sut.GetDisplayType(FileUpdateType.Assembly4); var fut2 = sut.GetDisplayType(FileUpdateType.Assembly2); var futInfo = sut.GetDisplayType(FileUpdateType.AssemblyInformational); var verStringFor4 = sut.GetVersionString(fut4); var verStringFor2 = sut.GetVersionString(fut2); var verStringForInfo = sut.GetVersionString(futInfo); // Initial values not incremented Assert.Equal("2.0.0.0", verStringFor4); Assert.Equal("2.0", verStringFor2); Assert.Equal("2.0-Unicorn.0", verStringForInfo); sut.PerformIncrement(); verStringFor4 = sut.GetVersionString(fut4); verStringFor2 = sut.GetVersionString(fut2); verStringForInfo = sut.GetVersionString(futInfo); // Values Following Single Increment Assert.Equal("2.0.0.1", verStringFor4); Assert.Equal("2.0", verStringFor2); Assert.Equal("2.0-Unicorn.1", verStringForInfo); sut.PerformIncrement(); verStringFor4 = sut.GetVersionString(fut4); verStringFor2 = sut.GetVersionString(fut2); verStringForInfo = sut.GetVersionString(futInfo); // Values Following Second Increment Assert.Equal("2.0.0.2", verStringFor4); Assert.Equal("2.0", verStringFor2); Assert.Equal("2.0-Unicorn.2", verStringForInfo); }
public void Display_Assem2_AllDigits_Correct() { var sut = new CompleteVersion(new VersionUnit("2"), new VersionUnit("0", "."), new VersionUnit("0", "."), new VersionUnit("0", ".", VersionIncrementBehaviour.ContinualIncrement)); var fut2 = sut.GetDisplayType(FileUpdateType.Assembly2); var verStringFor2 = sut.GetVersionString(fut2); Assert.Equal("2.0", verStringFor2); sut.PerformIncrement(); verStringFor2 = sut.GetVersionString(fut2); Assert.Equal("2.0", verStringFor2); sut.PerformIncrement(); verStringFor2 = sut.GetVersionString(fut2); Assert.Equal("2.0", verStringFor2); }
public void Display_Assem4_TextComponent_Correct() { var sut = new CompleteVersion(new VersionUnit("2"), new VersionUnit("0", "."), new VersionUnit("Unicorn", "-"), new VersionUnit("0", ".", VersionIncrementBehaviour.ContinualIncrement) ); var fut4 = sut.GetDisplayType(FileUpdateType.Assembly4); var verStringFor4 = sut.GetVersionString(fut4); Assert.Equal("2.0.0.0", verStringFor4); sut.PerformIncrement(); verStringFor4 = sut.GetVersionString(fut4); Assert.Equal("2.0.0.1", verStringFor4); sut.PerformIncrement(); verStringFor4 = sut.GetVersionString(fut4); Assert.Equal("2.0.0.2", verStringFor4); }
public void Display_Assem4_AllDigitsMultiIncrement_Correct() { var sut = new CompleteVersion(new VersionUnit("2", "", VersionIncrementBehaviour.ContinualIncrement), new VersionUnit("0", ".", VersionIncrementBehaviour.ContinualIncrement), new VersionUnit("0", ".", VersionIncrementBehaviour.ContinualIncrement), new VersionUnit("0", ".", VersionIncrementBehaviour.ContinualIncrement) ); var fut4 = sut.GetDisplayType(FileUpdateType.Assembly4); var verStringFor4 = sut.GetVersionString(fut4); Assert.Equal("2.0.0.0", verStringFor4); sut.PerformIncrement(); verStringFor4 = sut.GetVersionString(fut4); Assert.Equal("3.1.1.1", verStringFor4); sut.PerformIncrement(); verStringFor4 = sut.GetVersionString(fut4); Assert.Equal("4.2.2.2", verStringFor4); }