Наследование: IHospitalDataAccessLayer
Пример #1
0
 public void AddandGetAnalyzes_TwoAnalyzes_ShouldPass(string policyNumber, Analysis analysis)
 {
     var dataStorage = new HospitalDAL(_dataProvider, _connectionString);
     dataStorage.AddAnalysis(policyNumber, analysis);
     int analyzesCount = dataStorage.GetAnalyzes(policyNumber).Count;
     Assert.True(analyzesCount >= 1);
 }
Пример #2
0
 public void AddandGetPerson_ThreeDifferentPersons_ShouldPass(Person person)
 {
     var dataStorage = new HospitalDAL(_dataProvider, _connectionString);
     dataStorage.AddPerson(person);
     int personsCount = dataStorage.GetPersons(person.FirstName, person.LastName, person.PolicyNumber).Count;
     Assert.True(personsCount >= 1);
 }
Пример #3
0
        public MainWindow()
        {
            InitializeComponent();

            string connectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
            string dataProvider = ConfigurationManager.AppSettings["provider"];

            try
            {
                _dataAccessLayer = new HospitalDAL(dataProvider, connectionString);
            }
            catch (InvalidOperationException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                Environment.Exit(-1);
            }

            _canvasPainter = new CanvasPainter(MainCanvas);
        }
Пример #4
0
 public void GetTemplates_DBWithValues_ShouldPass()
 {
     var dataStorage = new HospitalDAL(_dataProvider, _connectionString);
     dataStorage.AddTemplate(new Template(new List<string> { "alcohol", "drugs" }, "Alcho2 Test"));
     int templatesCount = dataStorage.GetTemplates().Count;
     Assert.True(templatesCount >= 1);
 }
Пример #5
0
 public void AddandGetTemplate_TwoTemplates_ShouldPass(Template template)
 {
     var dataStorage = new HospitalDAL(_dataProvider, _connectionString);
     dataStorage.AddTemplate(template);
     Template expected = dataStorage.GetTemplate(template.Title);
     Assert.NotEqual(expected, null);
 }