Esempio n. 1
0
        public void TestProperties()
        {
            MixGroup group = new MixGroup() { Id = TestId, Name = TestName };

            Assert.AreEqual(TestId, group.Id, "Expected the property to persist");
            Assert.AreEqual(TestName, group.Name, "Expected the property to persist");
        }
Esempio n. 2
0
        public void TestJsonParsing()
        {
            MixGroup group = new MixGroup() { Id = "1234", Name = "Metal" };
            JObject json = JObject.Parse("{\"id\":\"1234\",\"name\":\"Metal\"}");
            MixGroup fromJson = MixGroup.FromJToken(json) as MixGroup;

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

            Assert.IsTrue(group.Equals(fromJson), "Expected the same MixGroup");
        }
 /// <summary>
 /// Gets the Mixes available in a group
 /// </summary>
 /// <param name="group">The mix group.</param>
 /// <param name="exclusiveTag">The exclusive tag.</param>
 /// <returns>
 /// A ListResponse containing Mixes or an Error
 /// </returns>
 public Task<ListResponse<Mix>> GetMixes(MixGroup group, string exclusiveTag)
 {
     var wrapper = new TaskCompletionSource<ListResponse<Mix>>();
     this._musicClient.GetMixes(result => wrapper.TrySetResult(result), group, exclusiveTag);
     return wrapper.Task;
 }
Esempio n. 4
0
 /// <summary>
 /// Gets the Mixes available in a group
 /// </summary>
 /// <param name="group">The mix group.</param>
 /// <param name="startIndex">The zero-based start index to fetch items from (e.g. to get the second page of 10 items, pass in 10).</param>
 /// <param name="itemsPerPage">The number of items to fetch.</param>
 /// <returns>
 /// A ListResponse containing Mixes or an Error
 /// </returns>
 public Task<ListResponse<Mix>> GetMixes(MixGroup group, int startIndex = MusicClient.DefaultStartIndex, int itemsPerPage = MusicClient.DefaultItemsPerPage)
 {
     var wrapper = new TaskCompletionSource<ListResponse<Mix>>();
     this._musicClient.GetMixes(result => wrapper.TrySetResult(result), group, startIndex, itemsPerPage);
     return wrapper.Task;
 }
Esempio n. 5
0
 public void TestOverrides()
 {
     MixGroup group = new MixGroup() { Id = TestId, Name = TestName };
     Assert.IsNotNull(group.GetHashCode(), "Expected a hash code");
     Assert.IsFalse(group.Equals(TestId), "Expected inequality");
 }