コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }