public async Task Should_be_able_to_add_a_message_to_a_user() { var parentRepository = new LinqRepository <Parent, int>(TransactionManager); User userToTestWith = await parentRepository.GetAsync(_userId); userToTestWith.SendMessage("some message", _mediator.Object); await FlushSessionAndEvict(userToTestWith); Parent parent = await parentRepository.GetAsync(_userId); parent.Messages.Count.Should().Be(1); }
public async Task Should_be_able_to_add_schedule_to_account() { var childToTestOn = await _childRepository.GetAsync(_childId); childToTestOn.Should().NotBeNull(); childToTestOn.Account.AddPaymentSchedule(DateTime.UtcNow, Interval.Week, 10, "Weekly pocket money"); await FlushSessionAndEvict(childToTestOn); var child = await _childRepository.GetAsync(_childId); child.Should().NotBeNull(); child.Account.PaymentSchedules[0].Id.Should().BePositive("schedule was not persisted"); }
public async Task Should_be_able_to_add_a_child_to_a_parent() { var linqRepository = new LinqRepository <Parent, int>(TransactionManager); Parent savedParent = await linqRepository.GetAsync(_parentId); savedParent.Should().NotBeNull(); savedParent.CreateChild("jim", "jim123", "passw0rd1"); savedParent.CreateChild("jenny", "jenny123", "passw0rd2"); savedParent.CreateChild("jez", "jez123", "passw0rd3"); await FlushSessionAndEvict(savedParent); Parent parent = await linqRepository.GetAsync(_parentId); parent.Children.Count.Should().Be(3); parent.Children[0].Name.Should().Be("jim"); parent.Children[1].Name.Should().Be("jenny"); parent.Children[2].Name.Should().Be("jez"); }