Exemple #1
0
        public void MasterBuildShouldHaveMasterGitHash()
        {
            // Arrange

            // Act
            var result = APIVersionModel.Create(MasterBuildVersionString);

            // Assert
            _ = result.Hash.Should().Be("0adbd77", null);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        public void MasterBuildShouldHaveMasterBranchName()
        {
            // Arrange

            // Act
            var result = APIVersionModel.Create(MasterBuildVersionString);

            // Assert
            _ = result.Branch.Should().Be("master", null);
        }
Exemple #4
0
        public void BugfixBuildShouldHavePackageBuildNumber()
        {
            // Arrange

            // Act
            var result = APIVersionModel.Create(BugfixBranchVersionString);

            // Assert
            _ = result.Build.Should().Be("20127+ci", null);
        }
Exemple #5
0
        public void BugfixBuildShouldHaveBugfixGitHash()
        {
            // Arrange

            // Act
            var result = APIVersionModel.Create(BugfixBranchVersionString);

            // Assert
            _ = result.Hash.Should().Be("562ce5a", null);
        }
Exemple #6
0
        public void BugfixBuildShouldHaveBugfixBranchName()
        {
            // Arrange

            // Act
            var result = APIVersionModel.Create(BugfixBranchVersionString);

            // Assert
            _ = result.Branch.Should().Be("bugfix-xggt-15608-master-embed-correct-versiontxt", null);
        }
Exemple #7
0
        public void BugfixBuildShouldHaveGitVersionBuildVersion()
        {
            // Arrange

            // Act
            var result = APIVersionModel.Create(BugfixBranchVersionString);

            // Assert
            _ = result.Version.Should().Be("3.99.0", null);
        }
Exemple #8
0
        public void MasterBuildShouldHaveGitVersionBuildVersion()
        {
            // Arrange

            // Act
            var result = APIVersionModel.Create(MasterBuildVersionString);

            // Assert
            _ = result.Version.Should().Be("3.88.0", null);
        }
Exemple #9
0
        public void MasterBuildShouldHavePackageBuildNumber()
        {
            // Arrange

            // Act
            var result = APIVersionModel.Create(MasterBuildVersionString);

            // Assert
            _ = result.Build.Should().Be("20116+ci", null);
        }
Exemple #10
0
        public void IfOnlyTheGitVersionReturnsDataMissing()
        {
            // Arrange
            const string missingData = "3.11.0";

            // Act
            var result = APIVersionModel.Create(missingData);

            // Assert
            _ = result.Version.Should().BeEmpty(null);
        }
Exemple #11
0
        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);
        }
Exemple #12
0
        public void MissingVersionData()
        {
            // Arrange
            string noVersionData = string.Empty;

            // Act
            var result = APIVersionModel.Create(noVersionData);

            // Assert
            _ = result.Version.Should().BeEmpty(null);
        }
Exemple #13
0
        public void MasterAndBugfixShouldNotMatch()
        {
            // Arrange
            var result1 = APIVersionModel.Create(MasterBuildVersionString);
            var result2 = APIVersionModel.Create(BugfixBranchVersionString);

            // Act
            var result = result1 == result2;

            // Assert
            _ = result.Should().BeFalse(null);
        }
Exemple #14
0
        public void DifferentObjectTypesShouldNotBeEqual()
        {
            // Arrange
            var    result1 = APIVersionModel.Create(BugfixBranchVersionString);
            object result2 = BugfixBranchVersionString;

            // Act
            var result = result1.Equals(result2);

            // Assert
            _ = result.Should().BeFalse(null);
        }
Exemple #15
0
        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);
        }
Exemple #16
0
        public void SameTwoStringShouldMatch()
        {
            // Arrange
            var result1 = APIVersionModel.Create(BugfixBranchVersionString);
            var result2 = APIVersionModel.Create(BugfixBranchVersionString);

            // Act
            var result = result1 == result2;

            // Assert
            _ = result.Should().BeTrue(null);
        }
Exemple #17
0
        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);
        }
Exemple #18
0
        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);
        }