diff --git a/.github/workflows/your_workflow_file.yml b/.github/workflows/your_workflow_file.yml new file mode 100644 index 000000000..3f1c2818e --- /dev/null +++ b/.github/workflows/your_workflow_file.yml @@ -0,0 +1,14 @@ +name: Example Workflow + +on: + push: + branches: + - main + pull_request: +jobs: + search-directory: + runs-on: ubuntu-latest + steps: + - name: Search Directory + run: | + echo 'Searched directory "." and found: [".config", ".csharpierrc.yaml", ".deepsource.toml", ".githooks", ".github", ".gitignore", ".vscode", ".wakatime-project", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE", "README.md", "SECURITY.md", "Src", "Tests", "VTEX.sln", "VTEX.sln.DotSettings", "_config.yml", "appveyor.yml", "assets", "docs", "logo.png", "packageLogo.png"]' diff --git a/Src/Controllers/CategorySpecificationController.cs b/Src/Controllers/CategorySpecificationController.cs new file mode 100644 index 000000000..04f35f7eb --- /dev/null +++ b/Src/Controllers/CategorySpecificationController.cs @@ -0,0 +1,21 @@ +using System; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + // Placeholder for actual data retrieval logic + var specifications = new List(); + // TODO: Replace with actual data retrieval from database or service + +namespace Src.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class CategorySpecificationController : ControllerBase + { + [HttpGet("{categoryId}/specifications")] + public IActionResult GetSpecificationsByCategory(int categoryId) + { + // TODO: Implement logic to retrieve specifications by category + return Ok(specifications); + } + } +} diff --git a/Src/Models/CategorySpecificationModel.cs b/Src/Models/CategorySpecificationModel.cs new file mode 100644 index 000000000..db6465af7 --- /dev/null +++ b/Src/Models/CategorySpecificationModel.cs @@ -0,0 +1,10 @@ +namespace Src.Models +{ + public class CategorySpecificationModel + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + // Add other relevant fields + } +} diff --git a/Tests/CategorySpecificationControllerTests.cs b/Tests/CategorySpecificationControllerTests.cs new file mode 100644 index 000000000..5be74364a --- /dev/null +++ b/Tests/CategorySpecificationControllerTests.cs @@ -0,0 +1,24 @@ +using System; +using Xunit; +using Src.Controllers; +using Microsoft.AspNetCore.Mvc; + +namespace Tests +{ + public class CategorySpecificationControllerTests + { + [Fact] + public void GetSpecificationsByCategory_ReturnsOkResult() + { + // Arrange + var controller = new CategorySpecificationController(); + int testCategoryId = 1; + + // Act + var result = controller.GetSpecificationsByCategory(testCategoryId); + + // Assert + Assert.IsType(result); + } + } +}