public async void IndexPost_GivenValidViewModel_ApiSendShouldBeCalled() { var model = new ReusedOffSiteCreateSiteViewModel(); var request = new AddAatfSite(); A.CallTo(() => requestCreator.ViewModelToRequest(model)).Returns(request); await controller.Index(model); A.CallTo(() => weeeClient.SendAsync(A <string> ._, request)).MustHaveHappened(Repeated.Exactly.Once); }
private AddAatfSite AddAatfSiteRequest() { var siteRequest = new AddAatfSite() { AatfId = Guid.NewGuid(), ReturnId = Guid.NewGuid(), AddressData = new SiteAddressData() { CountryId = Guid.NewGuid(), Address1 = "address1", Address2 = "address2", CountyOrRegion = "county", Name = "name", Postcode = "postcode", TownOrCity = "town" } }; return(siteRequest); }