Exemplo n.º 1
0
        public void Cannot_Add_Member_With_Shares_More_Than_Fund_Max_Shares()
        {
            var fund        = new Fund(Guid.NewGuid(), 2);
            var memberToAdd = Member.Create(fund.Id, "Ali Bordbar", 3);

            fund.Invoking(x => x.AddMember(memberToAdd))
            .Should().Throw <ArgumentOutOfRangeException>()
            .WithMessage("Cannot add member with shares greater than the Fund maximum shares.*");
        }
Exemplo n.º 2
0
        public void Cannot_Add_Duplicate_Member_To_Fund()
        {
            var fund        = new Fund(Guid.NewGuid(), 2);
            var memberToAdd = Member.Create(fund.Id, "Ali Bordbar", 2);

            fund.AddMember(memberToAdd);

            fund.Invoking(x => x.AddMember(memberToAdd))
            .Should().Throw <InvalidOperationException>()
            .WithMessage("Cannot add duplicate member to Fund.*");
        }