public void Put() { // 排列 TextController controller = new TextController(); // 操作 controller.Put(5, "value"); // 断言 }
public void Post() { // 排列 TextController controller = new TextController(); // 操作 controller.Post("value"); // 断言 }
public void Delete() { // 排列 TextController controller = new TextController(); // 操作 controller.Delete(5); // 断言 }
public void GetById() { // 排列 TextController controller = new TextController(); // 操作 string result = controller.Get(5); // 断言 Assert.AreEqual("value", result); }
public void Get() { // 排列 TextController controller = new TextController(); // 操作 IEnumerable<string> result = controller.Get(); // 断言 Assert.IsNotNull(result); Assert.AreEqual(2, result.Count()); Assert.AreEqual("value1", result.ElementAt(0)); Assert.AreEqual("value2", result.ElementAt(1)); }