public void TestGetItemCode_Successful() { var testGetItemCode = new ItemCodesController(); Mocker.MockContextHeader(testGetItemCode); string id = ""; JsonResult result = (JsonResult)testGetItemCode.Index(id); Console.WriteLine(result.Data); Assert.IsTrue((result.Data + "").Contains("All item codes")); }
public void TestGetItemCode_Invalid_Guid() { var testGetItemCode = new ItemCodesController(); Mocker.MockContextHeader(testGetItemCode); string id = "3A380F88-6B8B-40AF-AA14"; JsonResult result = (JsonResult)testGetItemCode.Index(id); Console.WriteLine(result.Data); Assert.IsTrue((result.Data + "").Contains("Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)")); }