mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-12 11:46:40 +00:00
test project setup
This commit is contained in:
parent
8534db6d71
commit
0117246777
3 changed files with 54 additions and 0 deletions
21
Tests/TicketManager.Tests/TicketManager.Tests.csproj
Normal file
21
Tests/TicketManager.Tests/TicketManager.Tests.csproj
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="../../TicketManager.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
|
||||||
|
<PackageReference Include="Moq" Version="4.13.1" />
|
||||||
|
<PackageReference Include="xunit" Version="2.4.1" />
|
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
|
||||||
|
<PackageReference Include="coverlet.collector" Version="1.0.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
using System;
|
||||||
|
using Xunit;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using TicketManager.Controllers;
|
||||||
|
using TicketManager.Data;
|
||||||
|
using TicketManager.Models;
|
||||||
|
|
||||||
|
namespace TicketManager.Tests
|
||||||
|
{
|
||||||
|
public class ProjectsControllerTests
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public ProjectsControllerTests()
|
||||||
|
{
|
||||||
|
// _context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Get_ReturnsProjectList()
|
||||||
|
{
|
||||||
|
// Arange
|
||||||
|
// var controller = new ProjectsController();
|
||||||
|
|
||||||
|
// Act
|
||||||
|
// var result = controller.GetProjects();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
// Assert.IsType<IEnumerable<Project>>(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
<PackageReference Include="Microsoft.OpenApi" Version="1.1.4" />
|
<PackageReference Include="Microsoft.OpenApi" Version="1.1.4" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="5.0.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="5.0.0" />
|
||||||
|
<PackageReference Include="Xunit" Version="2.4.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="client\" />
|
<Folder Include="client\" />
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue