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

            NoFormulaeExcelSanitizer sanitizer = new NoFormulaeExcelSanitizer();

            // Act
            string result = sanitizer.Sanitize(input);

            // Assert
            Assert.Equal("cmd|'/C ping 127.0.0.1'!A0", result);
        }
コード例 #2
0
        public void Sanitize_WithSafeInput_ReturnsInputUnmodified()
        {
            // Arrange
            string input = "This is a safe input.";

            NoFormulaeExcelSanitizer sanitizer = new NoFormulaeExcelSanitizer();

            // Act
            string result = sanitizer.Sanitize(input);

            // Assert
            Assert.Equal("This is a safe input.", result);
        }