Ejemplo n.º 1
0
        public void TestJsonParsing()
        {
            Mix mix = new Mix() { Id = "1234", Name = "Metal", ParentalAdvisory = true };
            JObject json = JObject.Parse("{\"id\":\"1234\",\"name\":\"Metal\",\"parentaladvisory\":true, \"thumbnails\": { \"100x100\": \"http://download.ch1.vcdn.nokia.com/p/d/music_image/100x100/1182.jpg\", \"200x200\": \"http://download.ch1.vcdn.nokia.com/p/d/music_image/200x200/1182.jpg\" } }");

            Mix fromJson = Mix.FromJToken(json) as Mix;

            Assert.IsNotNull(fromJson, "Expected a Mix object");

            Assert.IsTrue(mix.Equals(fromJson), "Expected the same Mix");
        }
Ejemplo n.º 2
0
 public void TestOverrides()
 {
     Mix mix = new Mix() { Id = TestId, Name = TestName };
     Assert.IsNotNull(mix.GetHashCode(), "Expected a hash code");
     Assert.IsFalse(mix.Equals(TestId), "Expected inequality");
 }