Commit 8c42acc4 authored by Steve Smith's avatar Steve Smith

Updating ToDoItem

parent fd6102e1
......@@ -5,7 +5,7 @@ namespace CleanArchitecture.Core.Entities
{
public class ToDoItem : BaseEntity
{
public string Title { get; set; }
public string Title { get; set; } = string.Empty;
public string Description { get; set; }
public bool IsDone { get; private set; }
......
using CleanArchitecture.Core.Events;
using CleanArchitecture.Core.Entities;
using CleanArchitecture.Core.Events;
using System.Linq;
using Xunit;
......@@ -9,7 +10,10 @@ namespace CleanArchitecture.Tests.Core.Entities
[Fact]
public void SetsIsDoneToTrue()
{
var item = new ToDoItemBuilder().Build();
var item = new ToDoItemBuilder()
.WithDefaultValues()
.Description("")
.Build();
item.MarkComplete();
......
......@@ -4,7 +4,7 @@ namespace CleanArchitecture.Tests
{
public class ToDoItemBuilder
{
private readonly ToDoItem _todo = new ToDoItem();
private ToDoItem _todo = new ToDoItem();
public ToDoItemBuilder Id(int id)
{
......@@ -24,6 +24,13 @@ namespace CleanArchitecture.Tests
return this;
}
public ToDoItemBuilder WithDefaultValues()
{
_todo = new ToDoItem() { Id = 1, Title = "Test Item", Description = "Test Description" };
return this;
}
public ToDoItem Build() => _todo;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment