public void AttributeEnumHelperTests_ConvertStringToEnum_Attack_Should_Pass()
        {
            // Arrange

            // Act
            var result = AttributeEnumHelper.ConvertStringToEnum("Attack");

            // Reset

            // Assert
            Assert.AreEqual(AttributeEnum.Attack, result);
        }
        public void AttributeEnumHelperTests_ConvertStringToEnum_Unknown_Should_Pass()
        {
            // Arrange

            // Act
            var result = AttributeEnumHelper.ConvertStringToEnum("Unknown");

            // Reset

            // Assert
            Assert.AreEqual(AttributeEnum.Unknown, result);
        }
        public void AttributeEnumHelperTests_ConvertStringToEnum_Defense_Should_Pass()
        {
            // Arrange

            // Act
            var result = AttributeEnumHelper.ConvertStringToEnum("Defense");

            // Reset

            // Assert
            Assert.AreEqual(AttributeEnum.Defense, result);
        }
        public void AttributeEnumHelperTests_ConvertStringToEnum_MaxHealth_Should_Pass()
        {
            // Arrange

            // Act
            var result = AttributeEnumHelper.ConvertStringToEnum("MaxHealth");

            // Reset

            // Assert
            Assert.AreEqual(AttributeEnum.MaxHealth, result);
        }
Example #5
0
        public void AttributeEnumHelper_ConvertStringToEnum_Should_Pass()
        {
            // Arrange

            var myList = Enum.GetNames(typeof(AttributeEnum)).ToList();

            AttributeEnum myActual;
            AttributeEnum myExpected;

            // Act

            foreach (var item in myList)
            {
                myActual   = AttributeEnumHelper.ConvertStringToEnum(item);
                myExpected = (AttributeEnum)Enum.Parse(typeof(AttributeEnum), item);

                // Assert
                Assert.AreEqual(myExpected, myActual, "string: " + item + TestContext.CurrentContext.Test.Name);
            }
        }