Exemplo n.º 1
0
        public void MatchingVersionsValidateCorrectly()
        {
            const string version = "1.1.0";
            const string path1   = "path/a";
            const string path2   = "path/b";

            var assurer = new VersionFieldConsistencyAssurer("Test");

            assurer.AssureVersionIsConsistent(version, path1);
            assurer.AssureVersionIsConsistent(version, path2);
        }
Exemplo n.º 2
0
        public void VersionMismatchThrowsFormatException()
        {
            const string version1 = "1.1.0";
            const string version2 = "1.2.0";
            const string path1    = "path/a";
            const string path2    = "path/b";

            var assurer = new VersionFieldConsistencyAssurer("Test");

            assurer.AssureVersionIsConsistent(version1, path1);
            Assert.Throws <FormatException>(() => assurer.AssureVersionIsConsistent(version2, path2));
        }
Exemplo n.º 3
0
        public void NullVersionDoesNotFailValidation()
        {
            const string version = "1.1.0";
            const string path1   = "path/a";
            const string path2   = "path/b";
            const string path3   = "path/c";
            const string path4   = "path/d";

            var assurer = new VersionFieldConsistencyAssurer("Test");

            assurer.AssureVersionIsConsistent(null, path1);
            assurer.AssureVersionIsConsistent(version, path2);
            assurer.AssureVersionIsConsistent(null, path3);
            assurer.AssureVersionIsConsistent(version, path4);
        }