public void GetMessage_ShouldReturnAllMessage()
        {
            var context = new TestMessageContext();

            context.Messages.Add(new Message("Romina", "Message 1"));
            context.Messages.Add(new Message("Romina", "Message 2"));
            context.Messages.Add(new Message("Tom", "Message 1"));

            var controller = new MessageController(context);
            var result     = controller.GetMessages() as TestMessageDbSet;

            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.Local.Count);
        }
        public void GetMessage_ShouldReturnMessagesFromThisUserId()
        {
            var context = new TestMessageContext();

            context.Messages.Add(GetMessagesDemo());
            context.Messages.Add(GetMessagesDemo());

            var controller    = new MessageController(context);
            var result        = controller.GetMessages("Tom") as IHttpActionResult;
            var contentResult = result as OkNegotiatedContentResult <IEnumerable <Message> >;

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(OkNegotiatedContentResult <IEnumerable <Message> >));
            Assert.IsNotNull(contentResult.Content);
            Assert.AreEqual(2, contentResult.Content.Count <Message>());
        }