public void MasterBuildShouldHaveMasterGitHash() { // Arrange // Act var result = APIVersionModel.Create(MasterBuildVersionString); // Assert _ = result.Hash.Should().Be("0adbd77", null); }
public void BugfixBuildToStringShouldReturnFullVersion() { // Arrange // Act var result = APIVersionModel.Create(BugfixBranchVersionString); // Assert _ = result.ToString().Should().Be("3.99.0-20127+ci.562ce5a.bugfix-xggt-15608-master-embed-correct-versiontxt", null); }
public void MasterBuildShouldHaveMasterBranchName() { // Arrange // Act var result = APIVersionModel.Create(MasterBuildVersionString); // Assert _ = result.Branch.Should().Be("master", null); }
public void BugfixBuildShouldHavePackageBuildNumber() { // Arrange // Act var result = APIVersionModel.Create(BugfixBranchVersionString); // Assert _ = result.Build.Should().Be("20127+ci", null); }
public void BugfixBuildShouldHaveBugfixGitHash() { // Arrange // Act var result = APIVersionModel.Create(BugfixBranchVersionString); // Assert _ = result.Hash.Should().Be("562ce5a", null); }
public void BugfixBuildShouldHaveBugfixBranchName() { // Arrange // Act var result = APIVersionModel.Create(BugfixBranchVersionString); // Assert _ = result.Branch.Should().Be("bugfix-xggt-15608-master-embed-correct-versiontxt", null); }
public void BugfixBuildShouldHaveGitVersionBuildVersion() { // Arrange // Act var result = APIVersionModel.Create(BugfixBranchVersionString); // Assert _ = result.Version.Should().Be("3.99.0", null); }
public void MasterBuildShouldHaveGitVersionBuildVersion() { // Arrange // Act var result = APIVersionModel.Create(MasterBuildVersionString); // Assert _ = result.Version.Should().Be("3.88.0", null); }
public void MasterBuildShouldHavePackageBuildNumber() { // Arrange // Act var result = APIVersionModel.Create(MasterBuildVersionString); // Assert _ = result.Build.Should().Be("20116+ci", null); }
public void IfOnlyTheGitVersionReturnsDataMissing() { // Arrange const string missingData = "3.11.0"; // Act var result = APIVersionModel.Create(missingData); // Assert _ = result.Version.Should().BeEmpty(null); }
public void MissingBranchName() { // Arrange const string noVersionData = "3.11.0-master.372.20116+ci.0adbd77"; // Act var result = APIVersionModel.Create(noVersionData); // Assert _ = result.Version.Should().BeEmpty(null); }
public void MissingVersionData() { // Arrange string noVersionData = string.Empty; // Act var result = APIVersionModel.Create(noVersionData); // Assert _ = result.Version.Should().BeEmpty(null); }
public void MasterAndBugfixShouldNotMatch() { // Arrange var result1 = APIVersionModel.Create(MasterBuildVersionString); var result2 = APIVersionModel.Create(BugfixBranchVersionString); // Act var result = result1 == result2; // Assert _ = result.Should().BeFalse(null); }
public void DifferentObjectTypesShouldNotBeEqual() { // Arrange var result1 = APIVersionModel.Create(BugfixBranchVersionString); object result2 = BugfixBranchVersionString; // Act var result = result1.Equals(result2); // Assert _ = result.Should().BeFalse(null); }
public void SameTwoTypesShouldBeEqual() { // Arrange var result1 = APIVersionModel.Create(BugfixBranchVersionString); object result2 = APIVersionModel.Create(BugfixBranchVersionString); // Act var result = result1.Equals(result2); // Assert _ = result.Should().BeTrue(null); }
public void SameTwoStringShouldMatch() { // Arrange var result1 = APIVersionModel.Create(BugfixBranchVersionString); var result2 = APIVersionModel.Create(BugfixBranchVersionString); // Act var result = result1 == result2; // Assert _ = result.Should().BeTrue(null); }
internal static APIVersionModel GetVersion() { APIVersionModel apiVersionModel = null; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("xggameplan.version.txt")) using (var reader = new StreamReader(stream)) { apiVersionModel = APIVersionModel.Create(reader.ReadToEnd()); } return(apiVersionModel); }
public void SameTwoStringShouldHaveSameGitHash() { // Arrange var result1 = APIVersionModel.Create(BugfixBranchVersionString); var result2 = APIVersionModel.Create(BugfixBranchVersionString); // Act var hash1 = result1.GetHashCode(); var hash2 = result2.GetHashCode(); // Assert _ = hash1.Should().Be(hash2, null); }