public AnunciosController(IAnuncioAppService _context, IDomainNotificationHandler <DomainNotification> notifications, ISuperDigitalClient _client) : base(notifications) { context = _context; client = _client; }
public void Deve_Retornar_Uma_Lista_De_Erros_Quando_So_Passar_A_Marca(string marca) { _anuncioAppService = _services.GetService <IAnuncioAppService>(); AnuncioAdicionarRequest request = new AnuncioAdicionarRequest { Marca = marca, }; _anuncioRepositoryMock.Setup(r => r.Adicionar(It.IsAny <Anuncio>())).Returns(_faker.Random.Number(1, 100)); AnuncioAdicionarResponse response = _anuncioAppService.Adicionar(request); Assert.True(response.Id == 0); Assert.True(response.Erros.Any()); }
public void Deve_Retornar_Uma_Mensagem_Marca_Obrigatoria_Quando_Nao_Passar_A_Marca_No_Adicionar() { _anuncioAppService = _services.GetService <IAnuncioAppService>(); AnuncioAdicionarRequest request = new AnuncioAdicionarRequest { Marca = "", Modelo = _faker.Vehicle.Model(), Versao = _faker.Vehicle.Vin(), Ano = _faker.Random.Number(4, 4), Quilometragem = _faker.Random.Number(1, 3), }; AnuncioAdicionarResponse response = _anuncioAppService.Adicionar(request); Assert.Contains(response.Erros, x => x.Descricao == "Marca é obrigatório" && x.Codigo == 400); }
public void Deve_Adicionar_Quando_Todos_Os_Campos_Estao_Preenchidos() { _anuncioAppService = _services.GetService <IAnuncioAppService>(); AnuncioAdicionarRequest request = new AnuncioAdicionarRequest { Marca = _faker.Vehicle.Type(), Modelo = _faker.Vehicle.Model(), Versao = _faker.Vehicle.Vin(), Ano = _faker.Random.Number(2000, 2020), Quilometragem = _faker.Random.Number(100000), }; _anuncioRepositoryMock.Setup(r => r.Adicionar(It.IsAny <Anuncio>())).Returns(_faker.Random.Number(1, 100)); AnuncioAdicionarResponse response = _anuncioAppService.Adicionar(request); Assert.True(response.Id > 0); Assert.True(!response.Erros.Any()); }
public AnunciosController(IAnuncioAppService anuncioApp) { _anuncioApp = anuncioApp; }
public AnunciosController(IAnuncioAppService _context, IDomainNotificationHandler <DomainNotification> notifications, IUser _user) : base(notifications, _user) { context = _context; }
public AnuncioController(IAnuncioAppService anuncioAppService) { _anuncioAppService = anuncioAppService; }
public AnunciosController(IAnuncioAppService service, IMapper mapper) { _service = service; _mapper = mapper; }
public AnunciosController(IAnuncioAppService anuncioApp, IClienteAppService clienteApp) { _anuncioApp = anuncioApp; _clienteApp = clienteApp; }
public AnunciosController(IMapper mapper, IAnuncioAppService anuncioApp) { _mapper = mapper; _anuncioApp = anuncioApp; }