示例#1
0
        public void AddAsyncInvalid()
        {
            IWatchListProvider provider = GetProvider();

            Assert.Throws <ArgumentNullException> (() => provider.AddAsync(null, new Person("buddyId")));
            Assert.Throws <ArgumentNullException> (() => provider.AddAsync(new Person("ownerId"), null));
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }