public void AddAsyncInvalid() { IWatchListProvider provider = GetProvider(); Assert.Throws <ArgumentNullException> (() => provider.AddAsync(null, new Person("buddyId"))); Assert.Throws <ArgumentNullException> (() => provider.AddAsync(new Person("ownerId"), null)); }
public void AddAsync() { IWatchListProvider provider = GetProvider(); provider.AddAsync(personA, personB).Wait(); provider.AddAsync(personA, personC).Wait(); IEnumerable <Person> buddies = provider.GetWatchedAsync(personA.Identity).Result; CollectionAssert.Contains(buddies, personB); CollectionAssert.Contains(buddies, personC); }
public void ClearAsync() { IWatchListProvider provider = GetProvider(); provider.AddAsync(personA, personB).Wait(); provider.AddAsync(personA, personC).Wait(); provider.ClearAsync(personA.Identity).Wait(); IEnumerable <Person> buddies = provider.GetWatchedAsync(personA.Identity).Result; Assert.IsNotNull(buddies); CollectionAssert.IsEmpty(buddies); }
public void GetIsWatcherAsync() { IWatchListProvider provider = GetProvider(); provider.AddAsync(personA, personB).Wait(); Assert.That(provider.GetIsWatcherAsync(personA.Identity, personB.Identity).Result, Is.True); Assert.That(provider.GetIsWatcherAsync(personB.Identity, personA.Identity).Result, Is.False); }