public void AcceptsSpecialVersionString(string specialVersionString) { var sut = new SemanticVersionConverter(); var actual = sut.Convert(specialVersionString); Assert.NotNull(actual); }
public void ConvertsNormalVersionsCorrectly(string normalVersionString) { var sut = new SemanticVersionConverter(); var expected = ExtractNormalVersion(normalVersionString); var actual = sut.Convert(normalVersionString); actual.AsSource().OfLikeness<VersionResult>().ShouldEqual(expected); }
public void AcceptsVersion(int major, int minor, int build) { var version = new Version(major, minor, build); var sut = new SemanticVersionConverter(); var actual = sut.Convert(version); Assert.NotNull(actual); }
public void InvalidVersionStringThrowsArgumentException(string versionString) { var sut = new SemanticVersionConverter(); Assert.Throws<ArgumentException>(() => sut.Convert(versionString)); }
public void DoesntAcceptValuesBiggerThanUShort(int major, int minor, int build) { var version = new Version(major, minor, build); var sut = new SemanticVersionConverter(); Assert.Throws<ArgumentOutOfRangeException>(() => sut.Convert(version)); }
public void ConvertsVersionCorrectly(int major, int minor, int build) { var expected = new VersionResult {Major = (ushort) major, Minor = (ushort) minor, Patch = (ushort) build}; var version = new Version(major, minor, build); var sut = new SemanticVersionConverter(); var actual = sut.Convert(version); actual.AsSource().OfLikeness<VersionResult>().ShouldEqual(expected); }