Пример #1
0
        public void ParseAucJsonFileTest()
        {
            // Arange
            IAucJsonFile   jsonFile = null;
            ResponseParser parser   = new ResponseParser();

            // Act
            jsonFile = parser.ParseAucJsonFile(aucJsonFile);

            // Assert
            Assert.IsNotNull(jsonFile);
            Assert.AreEqual("Deathguard", jsonFile.AucRealms[0].Name, "Неверное название реалма");
            Assert.AreEqual("deathguard", jsonFile.AucRealms[0].Slug, "Неверный slug");
            Assert.AreNotEqual(jsonFile.AucPositions.Count(), String.Format("ParseAucResponseTest. Прочитали Files {0}, а должно быть {1}", jsonFile.AucPositions.Count(), 1));

            Assert.AreEqual(1525884116, jsonFile.AucPositions[0].Auc, "Неверный Auc");
            Assert.AreEqual(110640, jsonFile.AucPositions[0].Item);
            Assert.AreEqual("Тест", jsonFile.AucPositions[0].Owner);
            Assert.AreEqual("Тест", jsonFile.AucPositions[0].OwnerRealm);
            Assert.AreEqual(1000000, jsonFile.AucPositions[0].Bid);
            Assert.AreEqual(1000000, jsonFile.AucPositions[0].BuyOut);
            Assert.AreEqual(1, jsonFile.AucPositions[0].Quantity);
            //Assert.AreEqual("LONG", jsonFile.AucPositions[0].TimeLeft);
            Assert.AreEqual(0, jsonFile.AucPositions[0].Rand);
            Assert.AreEqual(0, jsonFile.AucPositions[0].Seed);
            Assert.AreEqual(0, jsonFile.AucPositions[0].Context);
        }