private void ShouldReturnSuccessForDelete()
        {
            var operationSecceded = false;
            var dataAccessJsonStr = string.Empty;
            var formattedJsonStr  = string.Empty;

            try
            {
                var model = new PenjualanReturnModel()
                {
                    id           = 12,
                    penjualan_id = 13
                };

                _services.Delete(model);

                operationSecceded = true;
            }
            catch (DataAccessException ex)
            {
                operationSecceded = ex.DataAccessStatusInfo.OperationSucceeded;
                dataAccessJsonStr = JsonConvert.SerializeObject(ex.DataAccessStatusInfo);
                formattedJsonStr  = JToken.Parse(dataAccessJsonStr).ToString();
            }

            try
            {
                Assert.True(operationSecceded);
                _testOutputHelper.WriteLine("Data berhasil dihapus.");
            }
            finally
            {
                _testOutputHelper.WriteLine(formattedJsonStr);
            }
        }
Esempio n. 2
0
 public StatusBarangModel()
 {
     Pembelian       = new PembelianModel();
     Penjualan       = new PenjualanModel();
     PenyesuaianStok = new PenyesuaianStokModel();
     PenjualanReturn = new PenjualanReturnModel();
     PembelianReturn = new PembelianReturnModel();
 }
 public PenjualanReturnServicesFixture()
 {
     Model    = new PenjualanReturnModel();
     Services = new PenjualanReturnServices(null, new ModelDataAnnotationCheck());
 }