Esempio n. 1
0
        public void CreateCharacterTest()
        {
            var garden    = new Garden(factory, 10, 10);
            var character = garden.CreateCharacter(1) as TestCharacter;

            character.Cost.Should().Be(1);
            character.Motion.Should().Be(Motion.Walk);
        }
Esempio n. 2
0
        public void CalculateInstallationNumberTest()
        {
            const int maxInstallationNumber = 20;

            var garden = new Garden(factory, 10, maxInstallationNumber);

            garden.RestInstallationNumber.Should().Be(maxInstallationNumber);

            var character = garden.CreateCharacter(1);

            garden.RestInstallationNumber.Should().Be(maxInstallationNumber - 1);

            var sofa = garden.CreateSofa(2);

            garden.RestInstallationNumber.Should().Be(maxInstallationNumber - 2);

            garden.DeleteCharacter(character);
            garden.RestInstallationNumber.Should().Be(maxInstallationNumber - 1);

            garden.DeleteSofa(sofa);
            garden.RestInstallationNumber.Should().Be(maxInstallationNumber);
        }
Esempio n. 3
0
        public void CalculateCostTest()
        {
            const int userCost = 10;

            var garden = new Garden(factory, userCost, 10);

            garden.RestCost.Should().Be(userCost);

            var character = garden.CreateCharacter(1);

            garden.RestCost.Should().Be(userCost - 1);

            var sofa = garden.CreateSofa(2);

            garden.RestCost.Should().Be(userCost - 1 - 2);

            garden.DeleteCharacter(character);
            garden.RestCost.Should().Be(userCost - 2);

            garden.DeleteSofa(sofa);
            garden.RestCost.Should().Be(userCost);
        }