コード例 #1
0
        public void IsThreat_WithUnsafeInput_ReturnsTrue()
        {
            // Arrange
            string input = "=cmd|'/C ping 127.0.0.1'!A0";

            NoFormulaeExcelSanitizer sanitizer = new NoFormulaeExcelSanitizer();

            // Act
            bool result = sanitizer.IsThreat(input);

            // Assert
            Assert.Equal(true, result);
        }
コード例 #2
0
        public void IsThreat_WithSafeInput_ReturnsFalse()
        {
            // Arrange
            string input = "This is a safe input.";

            NoFormulaeExcelSanitizer sanitizer = new NoFormulaeExcelSanitizer();

            // Act
            bool result = sanitizer.IsThreat(input);

            // Assert
            Assert.Equal(false, result);
        }