// C# 테스트 및 학습 예시 using System; using System.Threading.Tasks; using Xunit; using FluentAssertions; namespace EthicsExamples.Tests { // ============================================ // 1. 보안 테스트 예시 // ============================================ public class SecurityTests { [Fact] public async Task GetUserByEmail_Should_PreventSqlInjection() { // Arrange var maliciousEmail = "' OR '1'='1' --"; // Act var result = await _userService.GetUserByEmailAsync(maliciousEmail); // Assert result.Should().BeNull(); } [Fact] public async Task CreatePost_Should_SanitizeHtmlContent() { // Arrange var xssAttempt = "

Safe content

"; // Act var post = await _postService.CreateAsync(new CreatePostDto { Title = "Test", Content = xssAttempt, AuthorId = TestUser.Id }); // Assert post.Content.Should().NotContain("