Esempio n. 1
0
        public void TestCreateCreature_InitializesCreatureCorrectly_ShouldReturnTrue(string name)
        {
            var factory = new NewCreatureFactory();

            var creature = factory.CreateCreature(name);

            Assert.AreEqual(name, creature.GetType().Name);
        }
Esempio n. 2
0
        public void TestCreateCreature_PassInvalidName_ShouldThrowWithValidMessage(string name)
        {
            var factory = new NewCreatureFactory();

            try
            {
                factory.CreateCreature(name);
            }
            catch (ArgumentException ex)
            {
                Assert.AreEqual("Invalid creature type \"Batka\"!", ex.Message);
            }
        }
Esempio n. 3
0
        public void TestCreateCreature_PassInvalidName_ShouldThrow(string name)
        {
            var factory = new NewCreatureFactory();

            Assert.Throws<ArgumentException>(() => factory.CreateCreature(name));
        }