public async void AddMarca() { //Arrange var marca = new Faker <Marca>("pt_BR") .RuleFor(m => m.Id, f => f.Random.Short(1, 100)) .RuleFor(m => m.Nome, f => f.Company.CompanyName()) .RuleFor(m => m.Ativo, f => f.Random.Bool()) .RuleFor(m => m.DataCriacao, f => f.Date.Recent()) .Generate(1)[0]; //Act var actual = await controller.Post(marca); //Assert actual.GetType().GetProperty("StatusCode").GetValue(actual).Should().BeEquivalentTo(201); mocker.GetMock <IRepositoryBase <Marca> >().Verify(m => m.Add(marca), Times.Once); mocker.GetMock <IUnitOfWork>().Verify(u => u.Commit(), Times.Once); }