Created Unit Test Project

This commit is contained in:
Matthew Burke
2023-08-14 17:10:38 -04:00
parent 19153c9d02
commit 4a4bcc81e0
10 changed files with 167 additions and 51 deletions

View File

@@ -33,6 +33,8 @@ namespace PWAPPv2
List<Source.DataObjects.PWImage> images;
string ConfigPath = "C:\\PWAPP\\Config\\Config.xml";
public MainWindow()
{
try
@@ -41,28 +43,37 @@ namespace PWAPPv2
}
catch (Exception)
{ }
try
{
images = new List<Source.DataObjects.PWImage>();
images = new List<Source.DataObjects.PWImage>();
apiconfig.LoadConfig(ConfigPath);
DataConfig = new Source.Database.DatabaseConfig(ConfigPath);
Source.Database.DatabaseConnection dbcon = new Source.Database.DatabaseConnection(DataConfig);
apiconfig.LoadConfig("./Config/Config.xml");
DataConfig = new Source.Database.DatabaseConfig("./Config/Config.xml");
Source.Database.DatabaseConnection dbcon = new Source.Database.DatabaseConnection(DataConfig);
apiCreds = new Source.DataObjects.APICredentials(apiconfig);
apiCreds = new Source.DataObjects.APICredentials(apiconfig);
apiConnection = new Source.API.APIConnection("http://apipatientweb.azurewebsites.net/",
apiCreds);
apiConnection = new Source.API.APIConnection("http://apipatientweb.azurewebsites.net/",
apiCreds);
InitializeComponent();
InitializeComponent();
PopulateComboBoxes();
PopulateComboBoxes();
patient = new Source.Patient();
patient = new Source.Patient();
patient.BuildFromDatabase(dbcon, args[0]);
patient.BuildFromDatabase(dbcon, args[0]);
this.DataContext = new Source.PatientGUIAdapter(patient);
this.DataContext = new Source.PatientGUIAdapter(patient);
}
catch(NullReferenceException)
{
}
catch(Exception e)
{
MessageBox.Show(e.Message);
}
}
private void PopulateComboBoxes()
@@ -244,7 +255,6 @@ namespace PWAPPv2
imageGrid.HorizontalAlignment = HorizontalAlignment.Left;
imageGrid.VerticalAlignment = VerticalAlignment.Top;
imageGrid.ShowGridLines = true;
imageGrid.Background = new SolidColorBrush(Colors.LightSteelBlue);
ColumnDefinition imageColumn = new ColumnDefinition();
imageColumn.Width = new GridLength(50);