public async Task AddFundsAsync_WithCorrectData_ShouldSuccessfullyUpdate() { var errorMessage = "UsersService AddFundsAsync() method does not work properly."; // Arrange var context = ApplicationDbContextInMemoryFactory.InitializeContext(); var usersRepository = new EfRepository <ApplicationUser>(context); var cloudinaryService = new Mock <ICloudinaryService>(); var usersService = new UsersService(usersRepository, cloudinaryService.Object); var userStore = new ApplicationUserStore(context); var userManager = new UserManager <ApplicationUser>(userStore, null, null, null, null, null, null, null, null); var user = new ApplicationUser() { Id = Guid.NewGuid().ToString(), UserName = "******", }; // Act await userManager.CreateAsync(user); var funds = usersRepository.All().First().Funds; await usersService.AddFundsAsync(user, 5); var actualResult = usersRepository.All().First().Funds; var expectedResult = funds + 5; // Assert Assert.True(expectedResult == actualResult, errorMessage); }