public void CreateItself() { _PostMessageCommand = new PostMessageCommand(); Assert.IsInstanceOf(typeof(PostMessageCommand), _PostMessageCommand.CreateCommand(new string[3], new UserRepository(), new MessageRepository(new Clock()), new SubscriptionRepository(), new MessagePrinter(new Console(), new Clock()))); }
public void CreateAUserIfNecessaryAndPostAMessage() { _PostMessageCommand = new PostMessageCommand { UserRepository = _UserRepository.Object, MessageRepository = _MessageRepository.Object, UserName = "******", MessageText = "I love the weather today" }; _PostMessageCommand.Execute(); _UserRepository.Verify(a => a.AddUser("Alice")); _MessageRepository.Verify(a => a.AddMessage(null, "I love the weather today")); }