Example #1
0
        public void Process_ShouldThrow_InvalidOperationException_WhenCallbackAndFormIdNullOrEmpty()
        {
            // Arrange
            var nullCallbackTagHelper = new RecaptchaInvisibleTagHelper(_settingsMock.Object, _optionsMock.Object, _tagHelperComponentManagerMock.Object)
            {
                Callback = null,
                FormId   = null
            };
            var emptyCallbackTagHelper = new RecaptchaInvisibleTagHelper(_settingsMock.Object, _optionsMock.Object, _tagHelperComponentManagerMock.Object)
            {
                Callback = string.Empty,
                FormId   = string.Empty
            };

            // Act


            // Assert
            Assert.Throws <InvalidOperationException>(() => nullCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
            Assert.Throws <InvalidOperationException>(() => emptyCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
        }
Example #2
0
        public void Process_ShouldThrow_ArgumentNullException_WhenOutputNull()
        {
            // Arrange


            // Act


            // Assert
            Assert.Throws <ArgumentNullException>(() => invisibleTagHelper.Process(_contextStub, null));
        }