コード例 #1
0
        public void TestSystem()
        {
            // Test system
            Dictionary <string, object> response = DeserializeJsonResource <Dictionary <string, object> >(Tests.Properties.Resources.edsmSystem);

            StarSystem system = fakeEdsmService.ParseStarMapSystem(JObject.FromObject(response));

            // Test Shinrarta Dezhra
            Assert.AreEqual("Shinrarta Dezhra", system.systemname);
            Assert.AreEqual(4345, system.EDSMID);
            Assert.AreEqual(55.71875M, system.x);
            Assert.AreEqual(17.59375M, system.y);
            Assert.AreEqual(27.15625M, system.z);
            Assert.IsTrue(system.requirespermit);
            Assert.AreEqual("Founders World", system.permitname);
            Assert.AreEqual("Pilots Federation", system.Faction.Allegiance.invariantName);
            Assert.AreEqual("Democracy", system.Faction.Government.invariantName);
            Assert.AreEqual("Pilots Federation Local Branch", system.Faction.name);
            Assert.AreEqual("None", system.Faction.presences.FirstOrDefault(p => p.systemName == system.systemname)?.FactionState?.invariantName);
            Assert.AreEqual(85206935, system.population);
            Assert.AreEqual("Common", system.Reserve.invariantName);
            Assert.AreEqual("High", system.securityLevel.invariantName);
            Assert.AreEqual("High Tech", system.Economies[0].invariantName);
            Assert.AreEqual("Industrial", system.Economies[1].invariantName);
        }