Skip to content

Commit

Permalink
Splited project
Browse files Browse the repository at this point in the history
  • Loading branch information
hiresm committed Jan 22, 2024
1 parent 5e13a50 commit f6cbd9b
Show file tree
Hide file tree
Showing 20 changed files with 83 additions and 33 deletions.
12 changes: 12 additions & 0 deletions AutomatedTestingApp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutomatedTestingApp.Tests",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{E59DE8FE-A6EE-40B3-AD51-442955494864}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutomatedTestingApp.Core", "src\AutomatedTestingApp.Core\AutomatedTestingApp.Core.csproj", "{91D08566-7879-4E76-B1F8-4322167BCC28}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutomatedTestingApp.Infrastructure", "src\AutomatedTestingApp.Infrastructure\AutomatedTestingApp.Infrastructure.csproj", "{4F09B7B7-A22A-4C27-B82F-6AEE0B222141}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -20,6 +24,14 @@ Global
{61CB4E97-F8C4-412C-BC70-72EF359172CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61CB4E97-F8C4-412C-BC70-72EF359172CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61CB4E97-F8C4-412C-BC70-72EF359172CB}.Release|Any CPU.Build.0 = Release|Any CPU
{91D08566-7879-4E76-B1F8-4322167BCC28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91D08566-7879-4E76-B1F8-4322167BCC28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91D08566-7879-4E76-B1F8-4322167BCC28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91D08566-7879-4E76-B1F8-4322167BCC28}.Release|Any CPU.Build.0 = Release|Any CPU
{4F09B7B7-A22A-4C27-B82F-6AEE0B222141}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4F09B7B7-A22A-4C27-B82F-6AEE0B222141}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F09B7B7-A22A-4C27-B82F-6AEE0B222141}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F09B7B7-A22A-4C27-B82F-6AEE0B222141}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{61CB4E97-F8C4-412C-BC70-72EF359172CB} = {E59DE8FE-A6EE-40B3-AD51-442955494864}
Expand Down
13 changes: 13 additions & 0 deletions src/AutomatedTestingApp.Core/AutomatedTestingApp.Core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.1" />
</ItemGroup>

</Project>
8 changes: 8 additions & 0 deletions src/AutomatedTestingApp.Core/Courses/Course.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace AutomatedTestingApp.Core.Courses;

public class Course
{
public Guid CourseId { get; set; }
public string Name { get; set; }

Check warning on line 6 in src/AutomatedTestingApp.Core/Courses/Course.cs

View workflow job for this annotation

GitHub Actions / Build

Non-nullable property 'Name' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 6 in src/AutomatedTestingApp.Core/Courses/Course.cs

View workflow job for this annotation

GitHub Actions / Build

Non-nullable property 'Name' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
public string Description { get; set; }

Check warning on line 7 in src/AutomatedTestingApp.Core/Courses/Course.cs

View workflow job for this annotation

GitHub Actions / Build

Non-nullable property 'Description' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 7 in src/AutomatedTestingApp.Core/Courses/Course.cs

View workflow job for this annotation

GitHub Actions / Build

Non-nullable property 'Description' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;

namespace AutomatedTestingApp.Areas.Identity.Models;
namespace AutomatedTestingApp.Core.Users;

[Keyless]
public class IdentityUser
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AutomatedTestingApp.Core\AutomatedTestingApp.Core.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Data\AutomatedTestingApp.db">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using AutomatedTestingApp.Areas.Identity.Models;
using AutomatedTestingApp.Core.Users;
using Microsoft.EntityFrameworkCore;

namespace AutomatedTestingApp.Helpers;
namespace AutomatedTestingApp.Infrastructure;

public class DataContext : DbContext
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
using System;
using AutomatedTestingApp.Helpers;
using AutomatedTestingApp.Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Linq.Expressions;

namespace AutomatedTestingApp.Repositories;
namespace AutomatedTestingApp.Infrastructure.Repositories;

public interface IRepository<TEntity>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AutomatedTestingApp.Repositories;
namespace AutomatedTestingApp.Infrastructure.Repositories;

public interface IUnitOfWork
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Linq.Expressions;
using AutomatedTestingApp.Helpers;
using Microsoft.EntityFrameworkCore;

namespace AutomatedTestingApp.Repositories;
namespace AutomatedTestingApp.Infrastructure.Repositories;

public class Repository<TEntity> : IRepository<TEntity> where TEntity : class
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using AutomatedTestingApp.Helpers;

namespace AutomatedTestingApp.Repositories;
namespace AutomatedTestingApp.Infrastructure.Repositories;

public class UnitOfWork : IUnitOfWork, IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Security.Claims;
using AutomatedTestingApp.Areas.Identity.Models;
using AutomatedTestingApp.Repositories;
using AutomatedTestingApp.Infrastructure.Repositories;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Mvc;
using IdentityUser = AutomatedTestingApp.Core.Users.IdentityUser;

namespace AutomatedTestingApp.Areas.Identity.Controllers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@model AutomatedTestingApp.Areas.Identity.Models.IdentityUser
@model AutomatedTestingApp.Core.Users.IdentityUser

<!DOCTYPE html>
<html lang="en">
Expand Down
18 changes: 5 additions & 13 deletions src/AutomatedTestingApp/AutomatedTestingApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,24 @@
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.11">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.11" />
</ItemGroup>


<ItemGroup>
<Folder Include="Migrations\" />
<_ContentIncludedByDefault Remove="Views\Account\Index.cshtml" />
<_ContentIncludedByDefault Remove="Views\Articles\Index.cshtml" />
</ItemGroup>



<ItemGroup>
<None Update="Data\AutomatedTestingApp.db">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<ProjectReference Include="..\..\AutomatedTestingApp.Infrastructure\AutomatedTestingApp.Infrastructure.csproj" />
<ProjectReference Include="..\AutomatedTestingApp.Infrastructure\AutomatedTestingApp.Infrastructure.csproj" />
</ItemGroup>



<ItemGroup>
<_ContentIncludedByDefault Remove="Views\Account\Index.cshtml" />
<_ContentIncludedByDefault Remove="Views\Articles\Index.cshtml" />
<Folder Include="Areas\Identity\Models\" />
</ItemGroup>


Expand Down
4 changes: 2 additions & 2 deletions src/AutomatedTestingApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AutomatedTestingApp.Helpers;
using AutomatedTestingApp.Repositories;
using AutomatedTestingApp.Infrastructure;
using AutomatedTestingApp.Infrastructure.Repositories;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.EntityFrameworkCore;

Expand Down
2 changes: 1 addition & 1 deletion src/AutomatedTestingApp/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"applicationUrl": "http://localhost:5142",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"CUSTOMCONNSTR_SQLITE": "Data/AutomatedTestingApp.db"
"CUSTOMCONNSTR_SQLITE": "../AutomatedTestingApp.Infrastructure/Data/AutomatedTestingApp.db"
}
},
"https": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading.Tasks;
using AutomatedTestingApp.Areas.Identity.Controllers;
using AutomatedTestingApp.Areas.Identity.Models;
using AutomatedTestingApp.Repositories;
using AutomatedTestingApp.Infrastructure.Repositories;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Mvc;
using Moq;
Expand Down

0 comments on commit f6cbd9b

Please sign in to comment.