示例#1
0
        private void CreateSubsetFile(object sender, RoutedEventArgs e)
        {
            var        remaining  = GetFilteredElements();
            List <int> elementIds = remaining
                                    ?.Select(x => x.Id)
                                    ?.ToList();

            if (elementIds.IsNullOrEmpty())
            {
                NotifyUserDrillQueueIsEmpty();
                return;
            }

            var writer = new FilteredDrillWriter(elementIds);
            var ret    = writer.WriteDrillFile();

            if (ret)
            {
                NotifyUserSuccess();
            }
            else
            {
                NotifyUserFailure();
            }
        }
示例#2
0
        public void FileWriterWritesData()
        {
            var list = new List <int> {
                1, 2, 3, 4, 5
            };
            var writer = new FilteredDrillWriter(list, TestFile);
            var ret    = writer.WriteDrillFile();

            Assert.True(ret);
        }
示例#3
0
        public void FileWriterWritesCorrectData()
        {
            var expected = new List <int> {
                1, 2, 3, 4, 5
            };
            var writer = new FilteredDrillWriter(expected, TestFile);
            var ret    = writer.WriteDrillFile();

            Assert.True(ret);

            var reader = new DrillReader(TestFile);
            var actual = reader.ReadFile();

            Assert.Equal(expected, actual);
        }