예제 #1
0
        public void GetMessagedTest()
        {
            IMittoMessageDao dal = Container.Resolve <IMittoMessageDao>();
            var messageCriteris  = new MessageSearchCriteria()
            {
                DateTimeFrom = DateTime.Now.AddDays(-5),
                DateTimeTo   = DateTime.Now,
                Skip         = 5,
                Take         = 10
            };
            var result = dal.GetMessagesInRange(messageCriteris);

            Assert.IsNotNull(result);
        }
예제 #2
0
        public void CommandHandlerTest()
        {
            var commandHandler = Container.Resolve <SmsCommandHandler>();
            var message        = new SmsRequest()
            {
                From = "049985", To = "888", Text = "Hello"
            };
            ICommand command = new AddSmsCommand(message);

            //   commandHandler.Handle(command);
            Assert.IsNotNull(commandHandler);

            IMittoMessageDao dal = Container.Resolve <IMittoMessageDao>();
        }
예제 #3
0
        public void GetCountryTest()
        {
            IMittoMessageDao dal = Container.Resolve <IMittoMessageDao>();
            var countries        = dal.GetCountries().ToList();

            foreach (var country in countries)
            {
                Assert.IsNotNull(country);
                Assert.IsNotNull(country.MobileCountryCode);
                Assert.IsNotNull(country.PackageName);
                Assert.IsNotNull(country.PricePerSms);
                Assert.IsNotNull(country.CountryCode);
            }
        }
예제 #4
0
 public MittoSmsController(ICommandBus bus, IMittoMessageDao dal, IEventDal eventDal)
 {
     _dal      = dal;
     _bus      = bus;
     _eventDal = eventDal;
 }