Exemplo n.º 1
0
        public async void DeleteContratoTeste()
        {
            CriarMultiplosContratos(_options);

            // Use a clean instance of the context to run the test
            using (var context = new DataContext(_options))
            {
                ContratoService contrato = new ContratoService(context);
                await contrato.DeleteContratoService(1);

                await Assert.ThrowsAsync <ArgumentNullException>(
                    async() => await contrato.GetContratoService(1)
                    );
            }
        }
Exemplo n.º 2
0
        public async void GetContratoTeste()
        {
            CriarMultiplosContratos(_options);

            // Use a clean instance of the context to run the test
            using (var context = new DataContext(_options))
            {
                ContratoService contrato  = new ContratoService(context);
                Contrato        resultado = await contrato.GetContratoService(2);

                Assert.NotEqual(resultado.DataContratacao, string.Empty);
                Assert.NotEqual(0, resultado.QuantidadeParcelas);
                Assert.NotEqual(0, resultado.Id);
                Assert.NotEqual(0, resultado.ValorFinanciado);
                Assert.NotNull(resultado.Prestacoes);
            }
        }