Ejemplo n.º 1
0
        public void Should_return_message_about_property_not_being_found_when_called_with_invalid_property_name_and_model_is_object()
        {
            // Given
            var model = new FakeModel { Name = "Nancy" };
            var drop = new DynamicDrop(model);

            // When
            var result = drop.BeforeMethod("age");

            // Then
            result.ShouldEqual("[Can't find :age in the model]");
        }
Ejemplo n.º 2
0
        public void Should_return_model_value_when_property_name_is_valid_and_model_is_object()
        {
            // Given
            var model = new FakeModel { Name = "Nancy" };
            var drop = new DynamicDrop(model);

            // When
            var result = drop.BeforeMethod("Name");

            // Then
            result.ShouldEqual("Nancy");
        }
Ejemplo n.º 3
0
        public void Should_return_null_when_called_with_invalid_property_name_and_model_is_object()
        {
            // Given
            var model = new FakeModel { Name = "Nancy" };
            var drop = new DynamicDrop(model);

            // When
            var result = drop.BeforeMethod("age");

            // Then
            result.ShouldBeNull();
        }