示例#1
0
        //// BadRequest ..
        public void GetContratos_Return_BadRequestResultById()
        {
            //Arrange
            var controller = new ContratosController(repository, mapper);
            int ctrId      = 25;

            //Act
            var data = controller.GetById(ctrId);

            //Assert
            Assert.IsType <BadRequestResult>(data.Result);
        }
示例#2
0
        //// NotFound ..
        public void GetContratos_Return_NotFoundById()
        {
            //Arrange
            var controller = new ContratosController(repository, mapper);
            int ctrId      = 1111;

            //Act
            var data = controller.GetById(ctrId);

            //Assert
            Assert.IsType <NotFoundResult>(data.Result);
        }
示例#3
0
        // OkResult ..
        public void GetContratos_Return_OkResultById()
        {
            //Arrange
            var controller = new ContratosController(repository, mapper);
            int ctrId      = 7;

            //Act
            var data = controller.GetById(ctrId);

            //Assert
            Assert.IsType <ContratoDTO>(data.Value);
        }
示例#4
0
        // GET retornar lista de objetos contrato ..
        public void GetContratos_MatchResultById()
        {
            //Arrange
            var controller = new ContratosController(repository, mapper);
            int ctrId      = 7;

            //Act
            var data = controller.GetById(ctrId);

            //Assert
            Assert.IsType <ContratoDTO>(data.Value);
            var ctr = data.Value.Should().BeAssignableTo <ContratoDTO>().Subject;

            Assert.Equal("7", ctr.Id.ToString());
            Assert.Equal("22/09/2019 01:00:00", ctr.Data.ToString());
            Assert.Equal("12", ctr.QtdeParcelas.ToString());
            Assert.Equal("5000,00", ctr.VlrFinanciado.ToString());
        }