public List.Result ExecuteList(Int64 mailIndex) { List cm = new List(mailIndex); List.Result rs = null; String s = ""; this.CheckAuthenticate(); s = this.Execute(cm); rs = new List.Result(s); return(rs); }
public void ExecuteList(Int64 mailIndex, Action <List <List.Result> > callbackFunction) { List cm = new List(mailIndex); EndGetResponse md = null; md = new EndGetResponse(delegate(String responseString) { List <List.Result> l = new List <List.Result>(); var rs = new List.Result(responseString); l.Add(rs); callbackFunction(l); }); this.CheckAuthenticate(); this.BeginExecute(cm, md); }
public async Task Given_A_Request_For_A_List_Then_Return_Success() { //Arrange var handlerResponse = new List.Result(new List <List.Result.Property>() { new List.Result.Property() { AddressLine1 = "First Line of Address", Postcode = "AB12 4CD" } }); mediatorMock.Setup(x => x.Send(It.IsAny <List.Query>(), default(CancellationToken))).Returns(Task.FromResult(handlerResponse)); //Act var sut = new PropertyController(mediatorMock.Object); var actionResult = await sut.List(new List.Query()) as OkObjectResult; //Assert Assert.NotNull(actionResult); Assert.Equal(actionResult.StatusCode, (Int32)System.Net.HttpStatusCode.OK); }