private static void AddThreeDreamEntriesTwoDays(IDreamDiaryViewModel entityUnderTest) { foreach (var dreamEntry in GetThreeDreamEntriesTwoDays()) { entityUnderTest.AddEntry(dreamEntry); } }
public FrmMain([NotNull] IEdreamsFactory factory) { InitializeComponent(); _factory = factory ?? throw new ArgumentNullException(nameof(factory)); _viewModel = factory.CreateDreamDiaryViewModel(); BindingSource.DataSource = _viewModel; _dreamDiaryBus = new DreamDiaryBus(_viewModel, factory.CreateDreamReaderWriterFactory()); _dreamDiaryBus.DiaryPersisted += (s, e) => RefreshEntries(); _dreamDiaryBus.SearchPerformed += (s, e) => RefreshEntries(); InitializeInterface(); }
public DreamDiaryBus([NotNull] IDreamDiaryViewModel dreamDiary, IDreamReaderWriterFactory dreamReaderWriterFactory) { _dreamDiary = dreamDiary ?? throw new ArgumentNullException(nameof(dreamDiary)); _dreamReaderWriterFactory = dreamReaderWriterFactory; }