Esempio n. 1
0
 public void WildcardPatch_VersionOnlyHasMajorMinor()
 {
     var converter = new JsonAvcToKspVersion();
     string json = @"{""MAJOR"":1, ""MINOR"":5, ""PATCH"":-1}";
     var reader = new JsonTextReader(new StringReader(json));
     var result = (KSPVersion)converter.ReadJson(reader, null, null, null);
     Assert.That(result, Is.EqualTo(new KSPVersion("1.5")));
 }
Esempio n. 2
0
 public void WildcardMajor_OutputsAnyVersion()
 {
     var converter = new JsonAvcToKspVersion();
     string json = @"{""MAJOR"":-1, ""MINOR"":-1, ""PATCH"":-1}";
     var reader = new JsonTextReader(new StringReader(json));
     var result = (KSPVersion) converter.ReadJson(reader, null, null, null);
     Assert.That(result.IsAny());
 }
Esempio n. 3
0
        public void MissingPatch_VersionOnlyHasMajorMinor()
        {
            var    converter = new JsonAvcToKspVersion();
            string json      = @"{""MAJOR"":1, ""MINOR"":5}";
            var    reader    = new JsonTextReader(new StringReader(json));
            var    result    = (KspVersion)converter.ReadJson(reader, null, null, null);

            Assert.That(result, Is.EqualTo(KspVersion.Parse("1.5")));
        }
Esempio n. 4
0
        public void MissingMajor_OutputsAnyVersion()
        {
            var    converter = new JsonAvcToKspVersion();
            string json      = @"{}";
            var    reader    = new JsonTextReader(new StringReader(json));
            var    result    = (KspVersion)converter.ReadJson(reader, null, null, null);

            Assert.That(!result.IsMajorDefined);
        }
Esempio n. 5
0
        public void WildcardMajor_OutputsAnyVersion()
        {
            var    converter = new JsonAvcToKspVersion();
            string json      = @"{""MAJOR"":-1, ""MINOR"":-1, ""PATCH"":-1}";
            var    reader    = new JsonTextReader(new StringReader(json));
            var    result    = (KspVersion)converter.ReadJson(reader, null, null, null);

            Assert.That(!result.IsMajorDefined);
        }
Esempio n. 6
0
        public void WildcardPatch_VersionOnlyHasMajorMinor()
        {
            var    converter = new JsonAvcToKspVersion();
            string json      = @"{""MAJOR"":1, ""MINOR"":5, ""PATCH"":-1}";
            var    reader    = new JsonTextReader(new StringReader(json));
            var    result    = (KSPVersion)converter.ReadJson(reader, null, null, null);

            Assert.That(result, Is.EqualTo(new KSPVersion("1.5")));
        }