public async Task CanGetAll() { Data.Add(_history); var result = await _controller.Get(); Assert.Single(result); Assert.Equal(result.First(), _history); }
public void GetAllHistories() { TestHelper.InitDatabase(); GetReady(); var actRes = controller.Get(); var response = actRes.ExecuteAsync(CancellationToken.None).Result; Assert.IsNotNull(response.Content); }
public void GetById() { // 排列 HistoryController controller = new HistoryController(); // 作用 HttpResponseMessage result = controller.Get("aa"); // 判斷提示 Assert.AreEqual("value", result); }
public void Get() { // 排列 HistoryController controller = new HistoryController(); // 作用 HttpResponseMessage result = controller.Get(); MainHistory value = new MainHistory(); // 判斷提示 Assert.IsNotNull(result); Assert.AreEqual(2, result.TryGetContentValue <MainHistory>(out value)); }
public async Task GetEmptyHistoryTest() { string expected = "History is empty"; var okResult = await historyController.Get(historyService); Assert.IsInstanceOf <OkObjectResult>(okResult.Result); Assert.AreEqual(expected, ((OkObjectResult)okResult.Result).Value); }