public async void LunchRepository_CreateUserAsync_ReturnsId() { // arrange LunchContext context = GetContext(); LunchRepository target = new LunchRepository(context); string googleId = "googleId"; string email = "*****@*****.**"; string name = "goodname"; string photoUrl = "photo"; // act var result = await target.CreateUserAsync(googleId, email, name, photoUrl); // assert UserEntity newUser = context.Users.Where(u => u.Name == name).FirstOrDefault(); Assert.Equal(newUser.Id, result.Id); }
public async void LunchRepository_CreateUserAsync_AddsEntryToTable() { // arrange LunchContext context = GetContext(); LunchRepository target = new LunchRepository(context); string googleId = "googleId"; string email = "*****@*****.**"; string name = "goodname"; string photoUrl = "photo"; // act await target.CreateUserAsync(googleId, email, name, photoUrl); // assert UserEntity newUser = context.Users.Where(u => u.GoogleId == googleId).FirstOrDefault(); Assert.True(newUser.Id > 0); Assert.Equal(email, newUser.Email); Assert.Equal(name, newUser.Name); }