public void Should_be_able_to_add_schedule_to_account()
        {
            var childRepository = new LinqRepository<Child>(TransactionManager, Session);
            var childToTestOn = childRepository.Get(childId);
            childToTestOn.Account.AddPaymentSchedule(DateTime.UtcNow, Interval.Week, 10, "Weekly pocket money");
            FlushSessionAndEvict(childToTestOn);

            var child = childRepository.Get(childId);
            child.Account.PaymentSchedules[0].Id.Should().BePositive("schedule was not persisted");
        }
        public void Should_be_able_to_add_transaction_to_account()
        {
            var childRepository = new LinqRepository<Child>(TransactionManager, Session);
            var childToTestOn = childRepository.Get(childId);
            childToTestOn.ReceivePayment(10, "Reward");
            FlushSessionAndEvict(childToTestOn);

            var child = childRepository.Get(childId);
            child.Account.Transactions[0].Id.Should().BePositive();
        }
        public void Should_be_able_to_add_a_message_to_a_user()
        {
            var parentRepository = new LinqRepository<Parent>(TransactionManager, Session);
            User userToTestWith = parentRepository.Get(userId);

            userToTestWith.SendMessage("some message", this.mediator.Object);

            FlushSessionAndEvict(userToTestWith);

            Parent parent = parentRepository.Get(userId);
            parent.Messages.Count.Should().Be(1);
        }
Exemplo n.º 4
0
        public void Should_be_able_to_add_transaction_to_account()
        {
            var childRepository = new LinqRepository <Child>(TransactionManager, Session);
            var childToTestOn   = childRepository.Get(childId);

            childToTestOn.ReceivePayment(10, "Reward");
            FlushSessionAndEvict(childToTestOn);

            var child = childRepository.Get(childId);

            child.Account.Transactions[0].Id.Should().BePositive();
        }
Exemplo n.º 5
0
        public void Should_be_able_to_add_schedule_to_account()
        {
            var childRepository = new LinqRepository <Child>(TransactionManager, Session);
            var childToTestOn   = childRepository.Get(childId);

            childToTestOn.Account.AddPaymentSchedule(DateTime.UtcNow, Interval.Week, 10, "Weekly pocket money");
            FlushSessionAndEvict(childToTestOn);

            var child = childRepository.Get(childId);

            child.Account.PaymentSchedules[0].Id.Should().BePositive("schedule was not persisted");
        }
Exemplo n.º 6
0
        public void Should_be_able_to_add_a_message_to_a_user()
        {
            var  parentRepository = new LinqRepository <Parent>(TransactionManager);
            User userToTestWith   = parentRepository.Get(_userId);

            userToTestWith.SendMessage("some message", _mediator.Object);

            FlushSessionAndEvict(userToTestWith);

            Parent parent = parentRepository.Get(_userId);

            parent.Messages.Count.Should().Be(1);
        }
Exemplo n.º 7
0
        public void Should_be_able_to_add_schedule_to_account()
        {
            var childToTestOn = _childRepository.Get(_childId);

            childToTestOn.Should().NotBeNull();

            childToTestOn.Account.AddPaymentSchedule(DateTime.UtcNow, Interval.Week, 10, "Weekly pocket money");
            FlushSessionAndEvict(childToTestOn);

            var child = _childRepository.Get(_childId);

            child.Should().NotBeNull();
            child.Account.PaymentSchedules[0].Id.Should().BePositive("schedule was not persisted");
        }
        public void Should_be_able_to_add_a_child_to_a_parent()
        {
            var linqRepository = new LinqRepository<Parent>(TransactionManager, Session);
            Parent savedParent = linqRepository.Get(parentId);
            savedParent.CreateChild("jim", "jim123", "passw0rd1");
            savedParent.CreateChild("jenny", "jenny123", "passw0rd2");
            savedParent.CreateChild("jez", "jez123", "passw0rd3");
            this.FlushSessionAndEvict(savedParent);

            Parent parent = linqRepository.Get(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");
        }
        public void Should_be_able_to_add_a_child_to_a_parent()
        {
            var    linqRepository = new LinqRepository <Parent>(TransactionManager, Session);
            Parent savedParent    = linqRepository.Get(parentId);

            savedParent.CreateChild("jim", "jim123", "passw0rd1");
            savedParent.CreateChild("jenny", "jenny123", "passw0rd2");
            savedParent.CreateChild("jez", "jez123", "passw0rd3");
            this.FlushSessionAndEvict(savedParent);


            Parent parent = linqRepository.Get(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");
        }