private void LoadData(DateTime tanggalMulai, DateTime tanggalSelesai) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfRetur = _bll.GetByTanggal(tanggalMulai, tanggalSelesai); GridListControlHelper.Refresh <ReturJualProduk>(this.gridList, _listOfRetur); } ResetButton(); }
public void GetByTanggalTest() { var index = 0; var tglMulai = new DateTime(2017, 1, 1); var tglSelesai = new DateTime(2017, 1, 21); var oList = _bll.GetByTanggal(tglMulai, tglSelesai); var obj = oList[index]; // tes retur Assert.IsNotNull(obj); Assert.AreEqual("2fb82570-d64e-4f2d-bd03-aab5bdf75884", obj.retur_jual_id); Assert.AreEqual("27d40236-c8ab-44be-bc47-7a9bbd68c31e", obj.jual_id); Assert.AreEqual("af01c916-7976-4518-a563-9d2a1851a912", obj.customer_id); Assert.AreEqual("201701210010", obj.nota); Assert.AreEqual(DateTime.Today, obj.tanggal); Assert.AreEqual("keterangan", obj.keterangan); Assert.AreEqual(160000, obj.total_nota); // tes item retur Assert.AreEqual(2, obj.item_retur.Count); index = 1; var itemRetur = obj.item_retur[index]; Assert.AreEqual("d7e888eb-6f9b-43ef-9a72-212588d2fb38", itemRetur.Produk.produk_id); Assert.AreEqual("12345", itemRetur.Produk.kode_produk); Assert.AreEqual("susu coklat", itemRetur.Produk.nama_produk); Assert.AreEqual(2, itemRetur.jumlah_retur); Assert.AreEqual(3500, itemRetur.harga_jual); // tes customer var customer = obj.Customer; Assert.AreEqual("af01c916-7976-4518-a563-9d2a1851a912", customer.customer_id); Assert.AreEqual("TE Shop", customer.nama_customer); Assert.AreEqual("Yogyakarta", customer.alamat); // tes jual var jual = obj.JualProduk; Assert.AreEqual("27d40236-c8ab-44be-bc47-7a9bbd68c31e", jual.jual_id); Assert.AreEqual("201701200045", jual.nota); }