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(); } }
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); }
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); }