Beispiel #1
0
        public void FewAnimalsCageSelectorIncompatibleAnimalsTest()
        {
            var rootCage = new Cage();

            rootCage.Children.Add(new Bear("bear", 1));
            var animal = new Wolf("test", 1);

            var mockSelector = GetCageSelectorMock();

            var cageSelector = new FewAnimalsCageSelector();

            cageSelector.Successor = mockSelector.Object;

            var result = cageSelector.SelectCage(rootCage, animal);

            mockSelector.Verify(c => c.SelectCage(rootCage, animal));
        }
Beispiel #2
0
        public void FewAnimalsCageSelectorTooManyAnimalsTest()
        {
            var rootCage = new Cage();

            rootCage.Children.Add(new Wolf("wolf1", 1));
            rootCage.Children.Add(new Wolf("wolf2", 1));
            rootCage.Children.Add(new Wolf("wolf3", 1));
            var animal = new Wolf("test", 1);

            var mockSelector = GetCageSelectorMock();

            var cageSelector = new FewAnimalsCageSelector();

            cageSelector.Successor = mockSelector.Object;

            var result = cageSelector.SelectCage(rootCage, animal);

            mockSelector.Verify(c => c.SelectCage(rootCage, animal));
        }