Exemplo n.º 1
0
        public void FindFindsOption()
        {
            OptionFinder finder = new OptionFinder(_mongoConnection);

            Email.Create(_mongoConnection, "test", new Schedule(), "", "");

            List <OptionBase> options = finder.Find();

            Assert.True(options.Single().GetType() == typeof(Email));
        }
Exemplo n.º 2
0
        public void FindFindsOption()
        {
            OptionFinder finder = new OptionFinder(Connection);

            DatabaseExposeData.Create(Connection, "test", "test", CreateScheduleAlwaysOnDoOnce());

            List <OptionBase> options = finder.Find();

            Assert.True(options.Count == 1);
            Assert.True(options.Any(option => option.GetType() == typeof(ExposeData)));
        }
Exemplo n.º 3
0
        public ThreadHolder(MongoConnection mongoConnection, OptionStatus optionStatus)
        {
            _mongoConnection = mongoConnection;

            DatabaseWorker = new DatabaseWorker();
            DatabaseWorker.Create(_mongoConnection);
            _lastUpdatedLastWorkTime = Clock.Now;

            _optionFinder  = new OptionFinder(_mongoConnection);
            _optionStatus  = optionStatus;
            _optionDecider = new OptionDecider(_mongoConnection, _optionStatus);
        }
Exemplo n.º 4
0
        public Heart()
        {
            //Log.FileWrite(GetType().Name, "Start Initialize");

            string databaseName = ConfigurationManager.AppSettings["mongoDatabaseName"];

            _connection   = MongoConnection.GetConnection(databaseName);
            _optionFinder = new OptionFinder(_connection);

            _optionStatus = new OptionStatus(_connection, _statusWriteInterval);

            //Log.FileWrite(GetType().Name, "End Initialize");
        }