Ejemplo n.º 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");
        }
Ejemplo n.º 2
0
        public void TestLinkingProperties()
        {
            var item = new Mix() { Id = TestId };
            var itemWithNullId = new Mix();

            Assert.IsNotNull(item.AppToAppUri, "Expected App to App URI to be calculated");
            Assert.IsNull(itemWithNullId.AppToAppUri, "Expected App to App URI not to be calculated");
        }
Ejemplo n.º 3
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.º 4
0
 public void TestPlayMixGoesAheadWhenItCan()
 {
     Mix mix = new Mix() { Id = "1234" };
     mix.Play();
     Assert.Pass();
 }
Ejemplo n.º 5
0
 public void TestMixIdPropertyIsRequiredForPlay()
 {
     Mix mix = new Mix();
     mix.Play();
 }
Ejemplo n.º 6
0
 public void HashCodeCanBeRetrievedWhenIdIsNull()
 {
     Mix mix = new Mix();
     Assert.IsNotNull(mix.GetHashCode(), "Expected a hash code");
 }
Ejemplo n.º 7
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");
 }