public void Incluir_Aplicacao_com_Sucesso() { var context = _ContextoFake.GerarContexto("InlcuirAplicacao_Sucesso"); context = ContextFakeSeeds.SeedAplicacao(context); var repo = new AplicacaoRepositorio(context); var services = new AplicacaoAplicacao(repo, _mapper); var controller = new AplicacaoController(services); controller.ControllerContext.HttpContext = new DefaultHttpContext(); controller.ControllerContext .HttpContext .User = FakeUserClaims.GerarUsuarioPadraoParaContexto(); var result = controller.Post(new CadastroAplicacaoViewModel() { Descricao = "Sistma de gestao de redes", Nome = "SGR" }); Assert.IsType <ActionResult <AplicacaoSimplesViewModel> >(result); var res = Assert.IsType <OkObjectResult>(result.Result); Assert.IsType <AplicacaoSimplesViewModel>(res.Value); }
public void Selecionar_Aviso_Com_Sucesso() { var context = _ContextoFake.GerarContexto("InlcuirAviso_Sucesso"); context = ContextFakeSeeds.SeedAviso(context); var repo = new AvisoRepositorio(context); var services = new AvisoAplicacao(repo, _mapper); var controller = new AvisoController(services); controller.ControllerContext.HttpContext = new DefaultHttpContext(); controller.ControllerContext .HttpContext .User = FakeUserClaims.GerarUsuarioPadraoParaContexto(); var result = controller.Get(); Assert.IsType <ActionResult <IEnumerable <AvisoViewModel> > >(result); var res = Assert.IsType <OkObjectResult>(result.Result); Assert.IsType <List <AvisoViewModel> >(res.Value); }
public void Selecionar_TipoLogId() { var context = _ContextoFake.GerarContexto("InlcuirTipoLog_Sucesso"); context = ContextFakeSeeds.SeedAplicacao(context); var repo = new TipoLogRepositorio(context); var services = new TipoLogAplicacao(repo, _mapper); var controller = new TipoLogController(services); controller.ControllerContext.HttpContext = new DefaultHttpContext(); controller.ControllerContext .HttpContext .User = FakeUserClaims.GerarUsuarioPadraoParaContexto(); var result = controller.Get(1); Assert.IsType <ActionResult <TipoLogViewModel> >(result); var res = Assert.IsType <OkObjectResult>(result.Result); Assert.IsType <TipoLogViewModel>(res.Value); }
public void Selecionar_Aplicacao_Com_Erro_No_Content() { var context = _ContextoFake.GerarContexto("InlcuirAplicacao_Sucesso"); context = ContextFakeSeeds.SeedAplicacao(context); var repo = new AplicacaoRepositorio(context); var services = new AplicacaoAplicacao(repo, _mapper); var controller = new AplicacaoController(services); controller.ControllerContext.HttpContext = new DefaultHttpContext(); controller.ControllerContext .HttpContext .User = FakeUserClaims.GerarUsuarioPadraoParaContexto(); var result = controller.GetAppId(null); Assert.IsType <ActionResult <AplicacaoSimplesViewModel> >(result); var res = Assert.IsType <NoContentResult>(result.Result); Assert.Equal(204, res.StatusCode); }
public AbpAuthorizationExceptionTestController_Tests() { FakeRequiredService = GetRequiredService <FakeUserClaims>(); }
public AbpAuthorizationExceptionTestPage_Tests() { _fakeRequiredService = GetRequiredService <FakeUserClaims>(); }
public AuthTestController_Tests() { _fakeRequiredService = GetRequiredService <FakeUserClaims>(); }
public FakeAuthenticationMiddleware(FakeUserClaims fakeUserClaims) { _fakeUserClaims = fakeUserClaims; }
public AuthTestPage_Tests() { _fakeRequiredService = GetRequiredService <FakeUserClaims>(); }
public ExceptionTestPage_Tests() { _fakeRequiredService = GetRequiredService <FakeUserClaims>(); }