public void SaveTask() { var repository = new GoalRepository(GetTestFileFolder()); var task = new Task(); task.Id = "A9D3DD63-A0F3-4E02-A14A-8DA64CF923C3"; task.Title = "New Task"; task.Initial = 5; task.Target = 200; task.Activity.Add(new TaskActivity() { Date = DateTime.Parse("2020-03-13"), Value = 88 }); repository.SaveTask(task); var savedTask = repository.GetTask("A9D3DD63-A0F3-4E02-A14A-8DA64CF923C3"); Assert.Equal("A9D3DD63-A0F3-4E02-A14A-8DA64CF923C3", savedTask.Id); Assert.Equal("New Task", savedTask.Title); Assert.Equal(5, savedTask.Initial); Assert.Equal(200, savedTask.Target); Assert.Equal(1, savedTask.Activity.Count); Assert.Equal(DateTime.Parse("2020-03-13"), savedTask.Activity[0].Date); Assert.Equal(88, savedTask.Activity[0].Value); }
public void GetTask() { var repository = new GoalRepository(GetTestFileFolder()); var task = repository.GetTask("290D51D0-6918-41CE-9734-8EA7870DB218"); var activity = task.Activity[0]; Assert.Equal("290D51D0-6918-41CE-9734-8EA7870DB218", task.Id); Assert.Equal("Highway to Hell - Lick 2", task.Title); Assert.Equal(0, task.Initial); Assert.Equal(100, task.Target); Assert.Equal(3, task.Activity.Count); Assert.Equal(DateTime.Parse("2019-05-04"), activity.Date); }