Beispiel #1
0
        public void TestProperties()
        {
            Mix mix = new Mix() { Id = TestId, Name = TestName, ParentalAdvisory = true, Thumb100Uri = new Uri("http://assets.ent.nokia.com/p/d/music_image/100x100/1182.jpg"), Thumb200Uri = new Uri("http://assets.ent.nokia.com/p/d/music_image/200x200/1182.jpg") };

            Assert.AreEqual(TestId, mix.Id, "Expected the property to persist");
            Assert.AreEqual(TestName, mix.Name, "Expected the property to persist");
        }
Beispiel #2
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");
        }
Beispiel #3
0
 public void TestPlayMixGoesAheadWhenItCan()
 {
     Mix mix = new Mix() { Id = "1234" };
     mix.Play();
     Assert.Pass();
 }
Beispiel #4
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");
 }
Beispiel #5
0
 public void TestMixIdPropertyIsRequiredForPlay()
 {
     Mix mix = new Mix();
     mix.Play();
 }