Пример #1
0
        public void Set_String_ReturnsSelf(string propertyName, String value)
        {
            // Arrange
            var emptyFluentAction = new EmptyFluentAction();

            // Act & Assert
            emptyFluentAction.Set(value, propertyName).ShouldBeSameAs(emptyFluentAction);
        }
Пример #2
0
        public void SetRef_ReturnsSelf(string propertyName, int value)
        {
            // Arrange
            var oldValue          = new Fixture().Create <int>();
            var emptyFluentAction = new EmptyFluentAction();

            // Act & Assert
            emptyFluentAction.Set(value, ref oldValue, propertyName).ShouldBeSameAs(emptyFluentAction);
        }
Пример #3
0
        public void Set_StringWithNullEmptyOrWhiteSpace_ShouldThrow(string propertyName, String value)
        {
            // Arrange
            var emptyFluentAction = new EmptyFluentAction();

            // Act & Assert
            ArgumentException exception = Should.Throw <ArgumentException>(() => emptyFluentAction.Set(value, propertyName));

            exception.Message.ShouldContain("null");
            exception.Message.ShouldContain("empty");
            exception.Message.ShouldContain("white-space characters");
        }
Пример #4
0
        public void SetRef_WithNullEmptyOrWhiteSpace_ShouldThrow(string propertyName, int value)
        {
            // Arrange
            var oldValue          = new Fixture().Create <int>();
            var emptyFluentAction = new EmptyFluentAction();

            // Act & Assert
            ArgumentException exception = Should.Throw <ArgumentException>(() => emptyFluentAction.Set(value, ref oldValue, propertyName));

            exception.Message.ShouldContain("null");
            exception.Message.ShouldContain("empty");
            exception.Message.ShouldContain("white-space characters");
        }