コード例 #1
0
        public TransmissionsTests()
        {
            var optionsBuilder   = new DbContextOptionsBuilder <TransmissionContext>();
            var mockContext      = new DbContextMock <TransmissionContext>(optionsBuilder.Options);
            var inboxSet         = mockContext.CreateDbSetMock(x => x.Inboxes);
            var transmissionsSet = mockContext.CreateDbSetMock(x => x.Transmissions);

            inboxes       = new Inboxes(mockContext.Object);
            transmissions = new Transmissions(mockContext.Object, inboxes);

            existingInboxId = @"ValidInbox";
            inboxes.CreateInbox(new Inbox {
                Id = existingInboxId, Email = @"*****@*****.**", ApiKey = "TheApiKey"
            });
        }
コード例 #2
0
ファイル: InboxAdapter.cs プロジェクト: infotech-gmbh/socomap
        IActionResult IInboxAdapter.InboxesCreate(InboxesCreateRequest inboxesCreateRequest)
        {
            var inbox = new Inbox {
                Id = inboxesCreateRequest.PartyName, Email = inboxesCreateRequest.Email
            };

            try
            {
                inboxApi.CreateInbox(inbox);
                return(StatusCode(200, new InboxesCreateResponse200 {
                    ApiKey = inbox.ApiKey
                }));
            }
            catch (ArgumentException)
            {
                return(StatusCode(409));
            }
        }
コード例 #3
0
ファイル: InboxesTests.cs プロジェクト: infotech-gmbh/socomap
 public void AllowsCreation()
 {
     inboxes.CreateInbox(new Inbox {
         Id = "PartyA"
     });
 }