Ejemplo n.º 1
0
        public void MissingMajor_OutputsAnyVersion()
        {
            var    converter = new JsonAvcToGameVersion();
            string json      = @"{}";
            var    reader    = new JsonTextReader(new StringReader(json));
            var    result    = (GameVersion)converter.ReadJson(reader, null, null, null);

            Assert.That(!result.IsMajorDefined);
        }
Ejemplo n.º 2
0
        public void MissingPatch_VersionOnlyHasMajorMinor()
        {
            var    converter = new JsonAvcToGameVersion();
            string json      = @"{""MAJOR"":1, ""MINOR"":5}";
            var    reader    = new JsonTextReader(new StringReader(json));
            var    result    = (GameVersion)converter.ReadJson(reader, null, null, null);

            Assert.That(result, Is.EqualTo(GameVersion.Parse("1.5")));
        }
Ejemplo n.º 3
0
        public void WildcardMajor_OutputsAnyVersion()
        {
            var    converter = new JsonAvcToGameVersion();
            string json      = @"{""MAJOR"":-1, ""MINOR"":-1, ""PATCH"":-1}";
            var    reader    = new JsonTextReader(new StringReader(json));
            var    result    = (GameVersion)converter.ReadJson(reader, null, null, null);

            Assert.That(!result.IsMajorDefined);
        }