예제 #1
0
        public void GetAllRoisFromDirectory_returns_the_same_roi_as_on_the_disk_in_alphabetical_order()
        {
            RoiReader service = new RoiReader(DataStub.TestDirectoryPath);
            var       allRoisFromDirectory = service.GetAllRoisFromDirectory();

            Assert.AreEqual(actual: allRoisFromDirectory.Count, expected: DataStub.ExpectedNumberOfRoisInDirectory, message: "Incorrect number of rois read from directory");

            Assert.AreEqual(actual: allRoisFromDirectory[0].Name, expected: DataStub.AddRoiDataset.Name);
            Assert.AreEqual(actual: allRoisFromDirectory[1].Name, expected: DataStub.ReadRoiDataset.Name);
            Assert.AreEqual(actual: allRoisFromDirectory[2].Name, expected: DataStub.WriteRoiDataset.Name);

            Assert.AreEqual(actual: allRoisFromDirectory[0].Height, expected: DataStub.AddRoiDataset.Height);
            Assert.AreEqual(actual: allRoisFromDirectory[1].Height, expected: DataStub.ReadRoiDataset.Height);
            Assert.AreEqual(actual: allRoisFromDirectory[2].Height, expected: DataStub.WriteRoiDataset.Height);

            Assert.AreEqual(actual: allRoisFromDirectory[0].Width, expected: DataStub.AddRoiDataset.Width);
            Assert.AreEqual(actual: allRoisFromDirectory[1].Width, expected: DataStub.ReadRoiDataset.Width);
            Assert.AreEqual(actual: allRoisFromDirectory[2].Width, expected: DataStub.WriteRoiDataset.Width);
        }
예제 #2
0
 /// <summary>
 /// Loads all Rois from directory to the list.
 /// </summary>
 /// <returns>
 /// Dataset with all rois.
 /// </returns>
 public IList <Roi> LoadAllRois() => _roireader.GetAllRoisFromDirectory();