Add project files.

This commit is contained in:
2022-10-06 16:53:07 +03:00
parent 45fac5e086
commit 6f3acce7d4
38 changed files with 1051 additions and 0 deletions
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PracticeCalendar.Domain\PracticeCalendar.Domain.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,56 @@
using FluentAssertions;
using PracticeCalendar.Domain.Entities;
namespace PracticeCalendar.UnitTests
{
public class PracticeEventTest
{
string _eventTitle = "Event1";
string _eventDescription = "Description";
string _attendeeName = "Claudiu Farcas";
string _atendeeEmail = "claudiu.farcas@testingbee.com";
[Fact]
public void InitializeProperties()
{
var practiceEvent = new PracticeEvent(_eventTitle, _eventDescription);
practiceEvent.Title.Should().Be(_eventTitle);
practiceEvent.Description.Should().Be(_eventDescription);
practiceEvent.Attendees.Should().HaveCount(0);
}
[Fact]
public void InitializeWithNullShouldThrowException()
{
Action act = () => {
var practiceEvent = new PracticeEvent(null, _eventDescription);
};
act.Should().Throw<ArgumentNullException>();
act = () => {
var practiceEvent = new PracticeEvent(_eventTitle, null);
};
act.Should().Throw<ArgumentNullException>();
act = () => {
var practiceEvent = new PracticeEvent(string.Empty, _eventDescription);
};
act.Should().Throw<ArgumentException>();
act = () => {
var practiceEvent = new PracticeEvent(_eventTitle, string.Empty);
};
act.Should().Throw<ArgumentException>();
}
[Fact]
public void AddAttendeeToEvent()
{
var practiceEvent = new PracticeEvent(_eventTitle, _eventDescription);
var testAttendee = new Attendee(_attendeeName, _atendeeEmail);
practiceEvent.AddAttendee(testAttendee);
practiceEvent.Attendees.Should().HaveCount(1);
}
}
}
+1
View File
@@ -0,0 +1 @@
global using Xunit;