public void ImportTest() { var dataContext = new DataContext(); var viewModelImport = new ViewModelImport(dataContext); var viewModelExport = new ViewModelExport(dataContext); List <ViewModelImport> viewModelImports = new List <ViewModelImport> { viewModelImport, new ViewModelImport(dataContext), new ViewModelImport(dataContext), new ViewModelImport(dataContext), new ViewModelImport(dataContext), new ViewModelImport(dataContext), }; var count = 0; viewModelImports.ForEach(item => item.PropertyChanged += (sender, args) => { Assert.AreEqual(nameof(ViewModelImport.Name), args.PropertyName); count++; }); for (int i = 0; i < TestStrings.Length; i++) { viewModelExport.Name = TestStrings[i]; Assert.AreEqual((i + 1) * viewModelImports.Count, count); foreach (var import in viewModelImports) { Assert.AreEqual(TestStrings[i], import.Name); } } }
public void ExportTest() { var dataContext = new DataContext(); var viewModelExport = new ViewModelExport(dataContext); var viewModelExport2 = new ViewModelExport(dataContext); }