Пример #1
0
        public void setInvoiceRemarkTest()
        {
            IVHelper target = new IVHelper(); // TODO: Initialize to an appropriate value

            //Insert remark
            ABiRemark remark = new ABiRemark() {
                InvoiceID = 99999999,
                RoleID = 4,
                Remark = "测试用的",
                RemarkPerson = "Unit Test",
                RoleName = "供应商",
                Username = "******",
                DateCreated = DateTime.Now
            }; // TODO: Initialize to an appropriate value

            ABiRemark actual;
            actual = target.setInvoiceRemark(remark);
            Assert.IsNotNull(actual);

            //Update remark
            actual.Remark = "测试更新备注";
            actual.RemarkPerson = "Unit单元测试";
            actual = target.setInvoiceRemark(remark);

            var obj = target.getInvoiceRemarks(99999999);
            Assert.AreEqual(1, obj.Count);
            Assert.AreEqual(obj[0].Username, "sgptp");

            var dbContext = new VPDAL.ABInvVPEntities();
            dbContext.ExecuteStoreCommand(String.Format("delete from ABi_Remark where ABi_Invoice_ID = {0}", 99999999));

            obj = target.getInvoiceRemarks(99999999);
            Assert.IsTrue(obj == null || obj.Count == 0);
        }
Пример #2
0
 public void getInvoiceRemarksTest()
 {
     IVHelper target = new IVHelper(); // TODO: Initialize to an appropriate value
     int invoiceId = 22126; // TODO: Initialize to an appropriate value
     //List<ABiRemark> expected = null; // TODO: Initialize to an appropriate value
     List<ABiRemark> actual;
     actual = target.getInvoiceRemarks(invoiceId);
     Assert.AreEqual(1, actual.Count);
     Assert.AreEqual(4, actual[0].RoleID);
     Assert.AreEqual("黑麦芽4吨", actual[0].Remark);
     Assert.AreEqual("300361", actual[0].RemarkPerson);
     //Assert.Inconclusive("Verify the correctness of this test method.");
 }