public void InsertUpdateDelete() { TownshipController townshipController = new TownshipController(); //create new entity Township township = new Township(); township.townshipId = Guid.NewGuid(); township.name = "Test Name"; township.entryDate = DateTime.Now; township.appUserId = Guid.NewGuid(); township.modifiedDate = DateTime.Now; township.remark = "Test Remark"; //insert var result1 = townshipController.Post(township); //update var result2 = townshipController.Post(township); //delete var result3 = townshipController.Delete(township.townshipId); //assert Assert.IsNotNull(result1); Assert.IsNotNull(result2); Assert.IsNotNull(result3); Assert.IsTrue(result1 is OkResult); Assert.IsTrue(result2 is OkResult); Assert.IsTrue(result3 is OkResult); }
public void Get() { TownshipController townshipController = new TownshipController(); Township[] townships = townshipController.Get().ToArray(); Assert.IsNotNull(townships); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { QuarterController quarCtlr = new QuarterController(); List <Quarterinfo> quarLst = new List <Quarterinfo>(); quarLst = quarCtlr.SelectAllQuarterinfo(); CustomerAddress.DataSource = quarLst; CustomerAddress.DataBind(); TownshipController townshipCtlr = new TownshipController(); List <TownshipInfo> townshipLst = new List <TownshipInfo>(); townshipLst = townshipCtlr.SelectAllTownshipInfo(); townshipData.DataSource = townshipLst; townshipData.DataBind(); SelectAllCustomer(); } }