Esempio n. 1
0
 private Organisation CreateOrganisation()
 {
     _organisation       = EntityHelpers.CreateOrganisation();
     _organisationDomain = _organisationsGateway.CreateOrganisation(_organisation);
     _organisation       = _mapper.FromDomain(_organisationDomain);
     return(_organisation);
 }
        public void GivenOrganisationDomainObjectOrganisationGetsCreated()
        {
            var organisation   = EntityHelpers.CreateOrganisation();
            var gatewayResult  = _classUnderTest.CreateOrganisation(organisation);
            var expectedResult = DatabaseContext.Organisations.Where(x => x.Name == organisation.Name).FirstOrDefault();

            gatewayResult.Should().NotBeNull();
            gatewayResult.Should().BeEquivalentTo(expectedResult, options =>
            {
                options.Excluding(ex => ex.ReviewerU);
                options.Excluding(ex => ex.Services);
                options.Excluding(ex => ex.UserOrganisations);
                return(options);
            });
        }