public void AccountTests_AddAccount() { //Arrange var person_code = 1; var model = new AccountsBuilder() .WithRandomProps() .WithPersonCode(person_code) .WithActive(true) .Build(); //Act _service.CreateAccount(model); //Assert Assert.IsTrue(_context.Account.Any(i => i.Code == model.Code)); }
public void AccountTests_RejectAddAccountWithDuplicateAccountNumber() { //Arrange var person_code = 1; var model = new AccountsBuilder() .WithRandomProps() .WithPersonCode(person_code) .WithAccountNumber("100133") .Build(); //Act _service.CreateAccount(model); //Assert Assert.IsTrue(_context.Account.Count(i => i.AccountNumber == "100133") == 1); }