示例#1
0
        public void DeveEnviarMensagensAgendadas()
        {
            //Arrange
            DeveAgendarEnvio();
            MessengerService service = new MessengerService(_memoryRepository);

            for (int i = 0; i < 10; i++)
            {
                ScheduleMessage messageToBeScheduled = new ScheduleMessage(
                    type: MessageType.CrossSellingHotel,
                    emailTo: "*****@*****.**",
                    dateToSend: DateTime.Now,
                    externalId: i,
                    companyId: 52
                );

                //Act
                service.DoSchedule(messageToBeScheduled);
            }

            //Act
            BaseRS result = service.Process().Result;

            //Assert
            Assert.IsTrue(result.Success);
            Assert.AreEqual(0, result.Errors.Count);

            //Assert
        }
示例#2
0
        public void DeveAgendarEnvio()
        {
            //Arrange
            MessengerService service = new MessengerService(_memoryRepository);

            ScheduleMessage messageToBeScheduled = new ScheduleMessage(
                    type: MessageType.CrossSellingHotel,
                    emailTo: "*****@*****.**",
                    dateToSend: DateTime.Now,
                    externalId: 12345678,
                    companyId: 52
                );

            //Act
            BaseRS result = service.DoSchedule(messageToBeScheduled);

            //Assert
            Assert.IsTrue(result.Success);
            Assert.AreEqual(0, result.Errors.Count);
        }