Exemplo n.º 1
0
        public void ItShouldReturnTrueForExitCountry()
        {
            const string country = "us";
            var          server  = new LogicalServerContract {
                ExitCountry = country
            };
            var spec = new ExitCountryServer(country);

            spec.IsSatisfiedBy(server).Should().BeTrue();
        }
Exemplo n.º 2
0
        private Specification <LogicalServerContract> ProfileServerSpec(Profile profile)
        {
            if (profile.ProfileType == ProfileType.Custom)
            {
                return(new ServerById(profile.ServerId));
            }

            Specification <LogicalServerContract> spec = new ServerByFeatures(ServerFeatures(profile));

            if (!string.IsNullOrEmpty(profile.CountryCode))
            {
                spec &= new ExitCountryServer(profile.CountryCode);
            }

            return(spec);
        }