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" }); }
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)); } }
public void AllowsCreation() { inboxes.CreateInbox(new Inbox { Id = "PartyA" }); }