示例#1
0
            public async Task ThenActionIsDenied(SupplierId subsidiaryId, SupplierId parentId)
            {
                var supplier = new Supplier(subsidiaryId);
                await supplier.CreatePendingLink(parentId, _publisherStub);

                await supplier.AcceptLink(parentId, _publisherStub);

                await Assert.ThrowsAsync <AlreadyAccepted>(() => supplier.AcceptLink(parentId, _publisherStub));
            }
示例#2
0
        public async Task GivenStatusAsLinkBetweenAnd(string status, string subsidiary, string parent)
        {
            _subsidiaryId = new SupplierId(1);
            _parentId     = new SupplierId(2);

            _aggregate = new Supplier(_subsidiaryId);
            if (status == "Pending")
            {
                await _aggregate.CreatePendingLink(_parentId, _eventPublisherStub.Object);
            }
            else if (status == "Declined")
            {
                await _aggregate.CreatePendingLink(_parentId, _eventPublisherStub.Object);

                await _aggregate.DeclineLink(_parentId, _eventPublisherStub.Object);
            }
            else if (status == "Accepted")
            {
                await _aggregate.CreatePendingLink(_parentId, _eventPublisherStub.Object);

                await _aggregate.AcceptLink(_parentId, _eventPublisherStub.Object);
            }
            else
            {
                throw new ArgumentException(nameof(status));
            }
        }
示例#3
0
 public async Task WhenIAcceptTheLink()
 {
     await _aggregate.AcceptLink(_parentId, _eventPublisherMock.Object);
 }