public void T001_CountMessages_EmptyList_0() { // Arrange var messageRepository = new Mock <IGenericRepository <Message> >(); var advertRepository = new Mock <IGenericRepository <Advert> >(); messageRepository.Setup(x => x.GetSet()).Returns(new List <Message>()); // Act var countMsgAndAdverts = new CountMessagesAndAdverts(messageRepository.Object, advertRepository.Object); var result = countMsgAndAdverts.CountMessages(); // Assert Assert.AreEqual(result, 0); }
public void T002_CountMessages_FilledList_CorrectNumberOfMsg() { // Arrange var messageRepository = new Mock <IGenericRepository <Message> >(); var advertRepository = new Mock <IGenericRepository <Advert> >(); messageRepository.Setup(x => x.GetSet()).Returns(new List <Message>() { new Message(), new Message(), new Message() }); // Act var countMsgAndAdverts = new CountMessagesAndAdverts(messageRepository.Object, advertRepository.Object); var result = countMsgAndAdverts.CountMessages(); // Assert Assert.AreEqual(result, 3); }