public void LayDSKhuVuc() { var controller = new KhuVucController(); var result = controller.Get() as List <KhuVuc>; Assert.AreEqual(4, result.Count); string now = DateTime.Now.ToString(); Console.WriteLine(now); }
public void LayKhuVucTheoID() { // var testBaoCao = GetTestBaoCao_CMND(); var controller = new KhuVucController(); var result = controller.Get(1) as KhuVuc; Assert.IsNotNull(result); Assert.AreEqual("Quận 1", result.TenKhuVuc); string now = DateTime.Now.ToString(); Console.WriteLine(now); }
public void KiemTraXoaKhuVuc() { var mock = new Mock <KhuVuc>(); var controller = new KhuVucController(mock.Object); IHttpActionResult actionResult = controller.Delete(9); Assert.IsNotNull(actionResult); Assert.IsInstanceOfType(actionResult, typeof(OkResult)); string now = DateTime.Now.ToString(); Console.WriteLine(now); }
public void KiemTraCapNhatKhuVuc() { var mock = new Mock <KhuVuc>(); var controller = new KhuVucController(mock.Object); IHttpActionResult actionResult = controller.Put(9, new KhuVuc { TenKhuVuc = "Quận 454" }); Assert.IsNotNull(actionResult); Assert.IsInstanceOfType(actionResult, typeof(OkResult)); string now = DateTime.Now.ToString(); Console.WriteLine(now); }