public void SetUp() { sender = new User { Name = "Sender user", Id = 1 }; receiver = new User { Name = "Receiver user", Id = 2 }; permissionContext = new FakePermissionContext(new UserWithPermissionsContract(receiver, ContentLanguagePreference.Default)); var received = sender.SendMessage(receiver, "Hello world", "Message body", false); receivedMessage = received.Item1; receivedMessage.Id = 1; receivedMessage.Read = true; var sent = receiver.SendMessage(sender, "Hello to you too", "Message body", false); sentMessage = sent.Item1; sentMessage.Id = 2; var noPermissionMessage = CreateEntry.UserMessageReceived(id: 39, sender: sender, receiver: sender, subject: "Hello world", body: "Message body"); repository = new FakeUserMessageRepository(sentMessage, sent.Item2, receivedMessage, received.Item2, noPermissionMessage); queries = new UserMessageQueries(repository, permissionContext); }
public void SetUp() { sender = new User { Name = "Sender user", Id = 1}; receiver = new User { Name = "Receiver user", Id = 2 }; permissionContext = new FakePermissionContext(new UserWithPermissionsContract(receiver, ContentLanguagePreference.Default)); receivedMessage = CreateEntry.UserMessage(id: 1, sender: sender, receiver: receiver, subject: "Hello world", body: "Message body", read: true); sentMessage = CreateEntry.UserMessage(id: 2, sender: receiver, receiver: sender, subject: "Hello to you too", body: "Message body"); var noPermissionMessage = CreateEntry.UserMessage(id: 39, sender: sender, receiver: sender, subject: "Hello world", body: "Message body"); repository = new FakeUserMessageRepository(sentMessage, receivedMessage, noPermissionMessage); queries = new UserMessageQueries(repository, permissionContext); }
public void SetUp() { sender = new User { Name = "Sender user", Id = 1 }; receiver = new User { Name = "Receiver user", Id = 2 }; permissionContext = new FakePermissionContext(new UserWithPermissionsContract(receiver, ContentLanguagePreference.Default)); receivedMessage = CreateEntry.UserMessage(id: 1, sender: sender, receiver: receiver, subject: "Hello world", body: "Message body", read: true); sentMessage = CreateEntry.UserMessage(id: 2, sender: receiver, receiver: sender, subject: "Hello to you too", body: "Message body"); var noPermissionMessage = CreateEntry.UserMessage(id: 39, sender: sender, receiver: sender, subject: "Hello world", body: "Message body"); repository = new FakeUserMessageRepository(sentMessage, receivedMessage, noPermissionMessage); queries = new UserMessageQueries(repository, permissionContext); }