Ejemplo n.º 1
0
        public void ReadExcludedLocations_InvalidValueInReadLocation_ThrowsCriticalFileReadException()
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(invalidDatabasePath))
            {
                // Call
                TestDelegate test = () => reader.ReadExcludedLocations().ToArray();

                // Assert
                Assert.Throws <CriticalFileReadException>(test);
            }
        }
Ejemplo n.º 2
0
        public void ReadExcludedLocations_EmptyTable_ReturnsEmptyEnumerable()
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(emptyDatabasePath))
            {
                // Call
                IEnumerable <long> locations = reader.ReadExcludedLocations();

                // Assert
                CollectionAssert.IsEmpty(locations);
            }
        }
Ejemplo n.º 3
0
 private ReadResult <IEnumerable <long> > ReadExcludedLocations(HydraRingSettingsDatabaseReader reader)
 {
     try
     {
         return(new ReadResult <IEnumerable <long> >(false)
         {
             Items = new[]
             {
                 reader.ReadExcludedLocations().ToArray()
             }
         });
     }
     catch (CriticalFileReadException e)
     {
         return(HandleCriticalFileReadError <IEnumerable <long> >(e.Message));
     }
 }
Ejemplo n.º 4
0
        public void ReadExcludedLocations_TableWithRows_ReturnsAllLocationIdsInTable()
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(completeDatabasePath))
            {
                // Call
                IEnumerable <long> locations = reader.ReadExcludedLocations();

                // Assert
                CollectionAssert.AreEqual(new[]
                {
                    700141,
                    700142,
                    700143,
                    700146
                }, locations);
            }
        }