public void AnalysisProvider_PersonAnalyzesArePropelyLoaded_ShouldPass(string firstName, string lastName, string middleName, string birthDate) { var person = new Person(firstName, lastName, middleName, DateTime.Parse(birthDate)); _personProvider.Save(ref person); var template = new Template("name" + firstName, "content"); _templateProvider.Save(template); var expectedAnalysis = new Analysis(template, person); _analysisProvider.Save(ref expectedAnalysis); IList <Analysis> analyzes = _analysisProvider.Load(person); _analysisProvider.Remove(expectedAnalysis); _personProvider.Remove(person); _templateProvider.Remove(template); Analysis actualAnalysis = analyzes[0]; Assert.True(analyzes.Count() == 1); Assert.True(AnalyzesAreEqual(expectedAnalysis, actualAnalysis)); }
private void LoadAllAnalyzes() { var analysisProvider = new AnalysisProvider(new DatabaseProvider()); IList <Analysis> analyzes = analysisProvider.Load(CurrentState.CurrentPerson); AddToDictionary(analyzes); }
private void AnalysisHistoryButton_Click(object sender, RoutedEventArgs e) { var analysisProvider = new AnalysisProvider(new DatabaseProvider()); var analyzes = analysisProvider.Load(CurrentState.CurrentPerson); if (analyzes.Count == 0) { MessageBox.Show("История анализов данного пациента пуста!", "Error!"); return; } Switcher.PageSwitcher.Navigate(new AnalysisHistory()); }