Exemple #1
0
        public void ReturnFalseWhenFieldDoesNotExist()
        {
            IDynamicFieldsContainer container = new DummyDynamicFieldsContainer();

            bool result = container.GetBoolean(DummyDynamicFieldsContainer.NonexistentFieldName);

            Assert.IsFalse(result, "False should be returned for field that doesn't exist.");
        }
Exemple #2
0
        public void ReturnFalseWhenGivenNullOrWhiteSpaceField(string nullOrEmptyFieldName)
        {
            IDynamicFieldsContainer container = new DummyDynamicFieldsContainer();

            bool result = container.GetBoolean(nullOrEmptyFieldName);

            Assert.IsFalse(result, "Null or empty field should always come back false.");
        }
Exemple #3
0
        public void ReturnFalseWhenValueIsNull()
        {
            IDynamicFieldsContainer container = new DummyDynamicFieldsContainer {
                String = null
            };

            bool result = container.GetBoolean(DummyDynamicFieldsContainer.StringFieldName);

            Assert.IsFalse(result, "A null field should return false.");
        }
Exemple #4
0
        public void ReturnValueOfBooleanString(bool expectedValue)
        {
            IDynamicFieldsContainer container = new DummyDynamicFieldsContainer {
                String = expectedValue.ToString()
            };

            bool result = container.GetBoolean(DummyDynamicFieldsContainer.StringFieldName);

            Assert.AreEqual(expectedValue, result, "String boolean value was not returned.");
        }
Exemple #5
0
        public void ReturnValueOfBooleanField(bool expectedValue)
        {
            IDynamicFieldsContainer container = new DummyDynamicFieldsContainer {
                Boolean = expectedValue
            };

            bool result = container.GetBoolean(DummyDynamicFieldsContainer.BooleanFieldName);

            Assert.AreEqual(expectedValue, result, "Boolean value was not returned.");
        }