public void ReturnsIListPartyObject()
        {
            IList <DbModels.Party> parties = Execute(EmbeddedResources.GetResource("candidates.json"));

            Assert.NotEmpty(parties);
            Assert.Equal(4, parties.Count);
            Assert.All(parties, p => Assert.True(p.Name.Length > 0));
            Assert.Equal(4, parties[0].Candidates.Count);
            Assert.Equal(3, parties[1].Candidates.Count);
            Assert.Equal(3, parties[2].Candidates.Count);
            Assert.Equal(3, parties[3].Candidates.Count);
            Assert.Equal("Mieszko I", parties[0].Candidates[0].Name);
            Assert.Equal("Kazimierz Wielki", parties[0].Candidates[3].Name);
            Assert.Equal("Wazowie", parties[3].Name);
        }
Esempio n. 2
0
        public void ParsesJsonResponse()
        {
            var ex = Record.Exception(() => Execute(EmbeddedResources.GetResource("disallowed.json")));

            Assert.Null(ex);
        }