Ejemplo n.º 1
0
        public void CannotHaveValidTerritoryWithoutDescriptionAndRegion()
        {
            // Register the IValidator service
            ServiceLocatorInitializer.Init();

            Territory territory = new Territory(null, null);

            territory.IsValid().ShouldBeFalse();
            territory.ValidationResults().Count.ShouldEqual(2);

            territory.RegionBelongingTo = new RegionWithPublicConstructor("South");
            territory.IsValid().ShouldBeFalse();
            territory.ValidationResults().Count.ShouldEqual(1);

            territory.Description = "Wherever";
            territory.IsValid().ShouldBeTrue();
        }