public void ShouldNotGetResourceTypesAndLogError()
        {
            MockedDatabase <ResourceType> database;
            ResourceTypeModule            module;
            MemoryLogger logger;


            logger   = new MemoryLogger();
            database = new MockedDatabase <ResourceType>(true, 3, (t) => new ResourceType()
            {
                ResourceTypeID = (ResourceTypeIDs)t
            });
            module = new ResourceTypeModule(logger, database);
            Assert.ThrowsException <PIODataException>(() => module.GetResourceTypes());
            Assert.IsNotNull(logger.Logs.FirstOrDefault(item => (item.Level == LogLevels.Error) && (item.ComponentName == module.ModuleName)));
        }
        public void ShouldGetResourceTypes()
        {
            MockedDatabase <ResourceType> database;
            ResourceTypeModule            module;

            ResourceType[] results;

            database = new MockedDatabase <ResourceType>(false, 3, (t) => new ResourceType()
            {
                ResourceTypeID = (ResourceTypeIDs)t
            });
            module  = new ResourceTypeModule(NullLogger.Instance, database);
            results = module.GetResourceTypes();
            Assert.IsNotNull(results);
            Assert.AreEqual(3, results.Length);
            for (int t = 0; t < 3; t++)
            {
                Assert.IsNotNull(results[t]);
                Assert.AreEqual((ResourceTypeIDs)t, results[t].ResourceTypeID);
            }
        }