public void InitializeStorageTask()
        {
            var elements = Substitute.For <IStorageElements>();

            elements.Container.Returns(Guid.NewGuid().ToString());
            elements.Table.Returns(Guid.NewGuid().ToString());
            elements.Queue.Returns(Guid.NewGuid().ToString());
            var config = new TaskConfiguration
            {
                StorageElements  = elements,
                Versions         = Substitute.For <IVersions>(),
                ConnectionString = connectionString,
            };

            var factory = new ImageTaskFactory();
            var tasks   = factory.Tasks(config);

            Assert.IsNotNull(tasks);
            var inits = from t in tasks
                        where t.GetType() == typeof(InitializeStorageTask)
                        select t;

            Assert.IsNotNull(inits);
            Assert.AreEqual(4, inits.Count());
        }
        public void TasksNull()
        {
            var elements = Substitute.For<IStorageElements>();
            elements.Container.Returns(Guid.NewGuid().ToString());
            elements.Table.Returns(Guid.NewGuid().ToString());
            elements.Queue.Returns(Guid.NewGuid().ToString());
            var config = new TaskConfiguration
            {
                StorageElements = elements,
                Versions = Substitute.For<IVersions>(),
                ConnectionString = connectionString,
            };

            var factory = new ImageTaskFactory();
            var tasks = factory.Tasks(config);

            Assert.IsNotNull(tasks);
        }
        public void TasksNull()
        {
            var elements = Substitute.For <IStorageElements>();

            elements.Container.Returns(Guid.NewGuid().ToString());
            elements.Table.Returns(Guid.NewGuid().ToString());
            elements.Queue.Returns(Guid.NewGuid().ToString());
            var config = new TaskConfiguration
            {
                StorageElements  = elements,
                Versions         = Substitute.For <IVersions>(),
                ConnectionString = connectionString,
            };

            var factory = new ImageTaskFactory();
            var tasks   = factory.Tasks(config);

            Assert.IsNotNull(tasks);
        }
        public void HasStorageQueueAutoScaler()
        {
            var elements = Substitute.For<IStorageElements>();
            elements.Container.Returns(Guid.NewGuid().ToString());
            elements.Table.Returns(Guid.NewGuid().ToString());
            elements.Queue.Returns(Guid.NewGuid().ToString());
            var config = new TaskConfiguration
            {
                StorageElements = elements,
                Versions = Substitute.For<IVersions>(),
                ConnectionString = connectionString,
            };

            var factory = new ImageTaskFactory();
            var tasks = factory.Tasks(config);

            Assert.IsNotNull(tasks);
            var task = (from t in tasks
                        where t.GetType() == typeof(StorageQueueAutoScaler<ImageQueued>)
                        select t).FirstOrDefault();

            Assert.IsNotNull(task);
        }
        public void HasStorageQueueAutoScaler()
        {
            var elements = Substitute.For <IStorageElements>();

            elements.Container.Returns(Guid.NewGuid().ToString());
            elements.Table.Returns(Guid.NewGuid().ToString());
            elements.Queue.Returns(Guid.NewGuid().ToString());
            var config = new TaskConfiguration
            {
                StorageElements  = elements,
                Versions         = Substitute.For <IVersions>(),
                ConnectionString = connectionString,
            };

            var factory = new ImageTaskFactory();
            var tasks   = factory.Tasks(config);

            Assert.IsNotNull(tasks);
            var task = (from t in tasks
                        where t.GetType() == typeof(StorageQueueAutoScaler <ImageQueued>)
                        select t).FirstOrDefault();

            Assert.IsNotNull(task);
        }
        public void InitializeStorageTask()
        {
            var elements = Substitute.For<IStorageElements>();
            elements.Container.Returns(Guid.NewGuid().ToString());
            elements.Table.Returns(Guid.NewGuid().ToString());
            elements.Queue.Returns(Guid.NewGuid().ToString());
            var config = new TaskConfiguration
            {
                StorageElements = elements,
                Versions = Substitute.For<IVersions>(),
                ConnectionString = connectionString,
            };

            var factory = new ImageTaskFactory();
            var tasks = factory.Tasks(config);

            Assert.IsNotNull(tasks);
            var inits = from t in tasks
                        where t.GetType() == typeof(InitializeStorageTask)
                        select t;

            Assert.IsNotNull(inits);
            Assert.AreEqual(4, inits.Count());
        }