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."); }
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."); }
public void ReturnFalseWhenValueIsNull() { IDynamicFieldsContainer container = new DummyDynamicFieldsContainer { String = null }; bool result = container.GetBoolean(DummyDynamicFieldsContainer.StringFieldName); Assert.IsFalse(result, "A null field should return false."); }
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."); }
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."); }