public async void LunchRepository_GetNopesAsync_ReturnsUsersNopes() { // arrange LunchContext context = GetContext(); LunchRepository target = new LunchRepository(context); UserEntity user = context.Users.Add(new UserEntity { Name = "bob", Nopes = "['thing1','thing2']", }).Entity; UserEntity user2 = context.Users.Add(new UserEntity { Name = "lilTimmy", Nopes = "['thing3','thing1']", }).Entity; context.SaveChanges(); IEnumerable <int> ids = context.Users.Select(u => u.Id); // act IEnumerable <string> result = await target.GetNopesAsync(ids); // assert Assert.Contains("thing1", result); Assert.Contains("thing2", result); Assert.Contains("thing3", result); Assert.Equal(3, result.Count()); }
public async void LunchRepository_GetNopesAsync_ReturnsEmptyListWithNoUsers() { // arrange LunchContext context = GetContext(); LunchRepository target = new LunchRepository(context); context.SaveChanges(); var ids = new List <int>(); // act IEnumerable <string> result = await target.GetNopesAsync(ids); // assert Assert.Equal(0, result.Count()); }