Exemple #1
0
        public void FriendlinessIncreasesOver100_BlockFromTop_Equals100()
        {
            var mockAnchiornis = new Anchiornis();

            mockAnchiornis.IncreaseFriendliness(100);

            Assert.Equal(mockAnchiornis.friendliness, mockAnchiornis.maxFriendliness);
        }
        public void ArchaeopteryxUs_SocialCoefficientIncreased_AnchiornisMoreAttractedThanOther()
        {
            var mockCharacter     = new Character();
            var mockArchaeopteryx = new Archaeopteryx();

            mockCharacter.CreditArchaeopteryx(mockArchaeopteryx);
            var mockFriendlyAnchiornis   = new Anchiornis();
            var mockUnfriendlyAnchiornis = new Anchiornis();

            mockFriendlyAnchiornis.IncreaseFriendliness(15);
            mockUnfriendlyAnchiornis.IncreaseFriendliness(15);
            var mockTile = new MockTile(mockCharacter, 3, 3, 2, 2);

            mockArchaeopteryx.OnUs(mockCharacter, mockFriendlyAnchiornis, mockTile);
            mockUnfriendlyAnchiornis.IncreaseFriendliness(mockCharacter.socialCoefficient);
            var friendlinessIsNotEqual = mockFriendlyAnchiornis.friendliness == mockUnfriendlyAnchiornis.friendliness;

            Assert.False(friendlinessIsNotEqual);
        }
Exemple #3
0
        public void FriendlinessIncrease_Increased_UpTo50()
        {
            var mockAnchiornis = new Anchiornis();

            mockAnchiornis.IncreaseFriendliness(20);

            int mockAnchiornisFriendliness = 50;

            Assert.Equal(mockAnchiornis.friendliness, mockAnchiornisFriendliness);
        }
Exemple #4
0
        public void JoinFriendlyAnchiornis_AnchiornisAgrees_True()
        {
            var mockCharacter  = new Character();
            var mockAnchiornis = new Anchiornis();

            mockAnchiornis.IncreaseFriendliness(25);
            mockCharacter.AddToPack(mockAnchiornis);

            var packCount = mockCharacter.pack.Count;

            Assert.Equal(1, packCount);
        }
Exemple #5
0
        public void JoinWithInteraction_AnchiornisAgrees_True()
        {
            var pack           = new Pack <Anchiornis>();
            var mockAnchiornis = new Anchiornis();

            mockAnchiornis.IncreaseFriendliness(25);
            pack.Join(mockAnchiornis);

            var packCount = pack.Count;

            Assert.True(packCount > 0);
        }
Exemple #6
0
        public void JoinNeutralAnchiornisToPack_AnchiornisRefuses_True()
        {
            var mockCharacter  = new Character();
            var mockAnchiornis = new Anchiornis();

            mockAnchiornis.IncreaseFriendliness(25);
            mockCharacter.AddToPack(mockAnchiornis);
            var neutralAnchiornis = new Anchiornis();

            mockCharacter.AddToPack(neutralAnchiornis);

            var packCount = mockCharacter.pack.Count;

            Assert.Equal(1, packCount);
        }
Exemple #7
0
        public void ArchaeopteryxOpened_PackEntersTerritory_PackInCreatures()
        {
            var mockCharacter = new Character();

            mockCharacter.CreditArchaeopteryx(new Archaeopteryx());
            var mockAnchiornis = new Anchiornis();

            mockAnchiornis.IncreaseFriendliness(25);
            mockCharacter.AddToPack(mockAnchiornis);
            var mockTile      = new MockTile(mockCharacter, 3, 3, 2, 2);
            var mockTerritory = new MockHiddenTerritory(mockCharacter, new Archaeopteryx(), mockTile);

            mockTerritory.OpenTerritory(mockCharacter);
            mockTerritory.EnterTerritory(mockCharacter);
            var packMoved = mockTerritory.creatures.Contains(mockAnchiornis);

            Assert.True(packMoved);
        }
Exemple #8
0
        public void movementWithPack_packMoved_True()
        {
            var mockCharacter  = new Character();
            var mockAnchiornis = new Anchiornis();

            mockAnchiornis.IncreaseFriendliness(25);
            mockCharacter.AddToPack(mockAnchiornis);
            var mockTile = new MockTile(mockCharacter, 3, 3, 2, 2);

            mockTile.creatures = new List <ICreature>()
            {
                mockCharacter, mockAnchiornis
            };

            var  movement  = mockCharacter.Move(mockTile, ICreature.direction.N) as ITile;
            bool packMoved = movement.creatures.Contains(mockAnchiornis) ? true : false;

            Assert.True(packMoved);
        }
Exemple #9
0
        public void OnlyPackMoved_CharacterOnNextTile_True()
        {
            var mockCharacter     = new Character();
            var mockAnchiornis    = new Anchiornis();
            var neutralAnchiornis = new Anchiornis();

            mockAnchiornis.IncreaseFriendliness(25);
            mockCharacter.AddToPack(mockAnchiornis);
            var mockTile = new MockTile(mockCharacter, 3, 3, 2, 2);

            mockTile.creatures = new List <ICreature>()
            {
                mockCharacter, mockAnchiornis, neutralAnchiornis
            };

            var  movement       = mockCharacter.Move(mockTile, ICreature.direction.NW) as ITile;
            bool characterMoved = movement.creatures.Contains(mockCharacter) ? true : false;

            Assert.True(characterMoved);
        }
Exemple #10
0
        public void PackMovingFromEnemy_enemyFailedPackMoved_False()
        {
            var mockCharacter   = new Character();
            var mockAnchiornis  = new Anchiornis();
            var enemyAnchiornis = new Anchiornis();

            mockAnchiornis.IncreaseFriendliness(25);
            mockCharacter.AddToPack(mockAnchiornis);
            var mockTile = new MockTile(mockCharacter, 3, 3, 2, 2);

            mockTile.creatures = new List <ICreature>()
            {
                mockCharacter, mockAnchiornis, enemyAnchiornis
            };

            var movement = mockCharacter.Move(mockTile, ICreature.direction.N) as ITile;

            enemyAnchiornis.Move(mockTile, movement, false);
            bool packMoved  = movement.creatures.Contains(mockAnchiornis) ? true : false;
            bool enemyMoved = movement.creatures.Contains(enemyAnchiornis) ? true : false;

            Assert.True(packMoved);
            Assert.False(enemyMoved);
        }
Exemple #11
0
 public void OnUs(Character character, Anchiornis us, ITerritory territory)
 {
     Console.WriteLine($"You are spreading your feathers, trying to attract the attention of {us.name}");
     us.IncreaseFriendliness(character.socialCoefficient + 1);
     CoolDownSet();
 }