public void SearchTest_Basic() { var dummyResponse = new ListRemoteResponse() { CaseloadList = new [] { new CaseloadItemRemote() { ActualEndDate = DateTime.Now, FirstName = "Mickey", Age = 50, CommencementDate = DateTime.Now, Surname = "Mouse" } } }; var request = new CaseLoadListModel() { OrgCode = "HOST", SiteCode = "QM60" }; mockCaseLoadWcf.Setup(m => m.GetCaseloadListRemote(It.IsAny <ListRemoteRequest>())).Returns(dummyResponse); var response = SystemUnderTest().GetCaseLoad(request); Assert.IsNotNull(response); Assert.IsNotNull(response.Results != null); Assert.IsTrue(response.Results.Count == 1); Assert.IsNotNull(response.Results[0].FirstName == "Mickey"); Assert.IsNotNull(response.Results[0].Surname == "Mouse"); }
public void SearchTest_WithFaultException() { var request = new CaseLoadListModel() { OrgCode = "HOST", SiteCode = "QM60" }; mockCaseLoadWcf.Setup(m => m.GetCaseloadListRemote(It.IsAny <ListRemoteRequest>())).Throws(new FaultException()); var response = SystemUnderTest().GetCaseLoad(request); }