Skip to content

Commit

Permalink
Merge pull request #94 from DoWhile-UOM/dev
Browse files Browse the repository at this point in the history
Change unit testing database into Azure from FIT-IOT
  • Loading branch information
Isuranga-2001 authored Jun 9, 2024
2 parents e80e2ea + 284f416 commit de203eb
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions FirstStepTest/SkillMatchingAlgorithmTesting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ public SkillMatchingAlgorithmTesting()

private void SeedDatabaseFromOriginal()
{
//var originalOptions = new DbContextOptionsBuilder<DataContext>()
// .UseSqlServer("Data Source=192.248.11.34;Database=jobsearch-app;User ID=JobAppMasterUser;Password=FirstStep2024User;TrustServerCertificate=true")
// .Options;

var originalOptions = new DbContextOptionsBuilder<DataContext>()
.UseSqlServer("Data Source=192.248.11.34;Database=jobsearch-app;User ID=JobAppMasterUser;Password=FirstStep2024User;TrustServerCertificate=true")
.UseSqlServer("Server=tcp:firststepserver.database.windows.net;Initial Catalog=firststepdb;Persist Security Info=False;User ID=adminteam;Password=58ashates88$8;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;")
.Options;

using (var originalContext = new DataContext(originalOptions))
Expand Down Expand Up @@ -110,7 +114,7 @@ private void SeedDatabaseFromOriginal()
public async Task TestSkillMatchingAlgorithm_Colombo()
{
// arange
int seekerId = 1073;
int seekerId = 4;
Coordinate seekerLocation = new Coordinate { Longitude = 79.861244, Latitude = 6.927079 };

// Act
Expand All @@ -121,7 +125,7 @@ public async Task TestSkillMatchingAlgorithm_Colombo()
public async Task TestSkillMatchingAlgorithm_Kandy()
{
// arange
int seekerId = 1073;
int seekerId = 4;
Coordinate seekerLocation = new Coordinate { Longitude = 80.636696, Latitude = 7.291418 };

// Act
Expand All @@ -132,7 +136,7 @@ public async Task TestSkillMatchingAlgorithm_Kandy()
public async Task TestSkillMatchingAlgorithm_Galle()
{
// arange
int seekerId = 1073;
int seekerId = 4;
Coordinate seekerLocation = new Coordinate { Longitude = 80.220978, Latitude = 6.053519 };

// Act
Expand All @@ -143,7 +147,7 @@ public async Task TestSkillMatchingAlgorithm_Galle()
public async Task TestSkillMatchingAlgorithm_Gampaha()
{
// arange
int seekerId = 1073;
int seekerId = 4;
Coordinate seekerLocation = new Coordinate { Longitude = 80.014366, Latitude = 7.087310 };

// Act
Expand All @@ -154,7 +158,7 @@ public async Task TestSkillMatchingAlgorithm_Gampaha()
public async Task TestSkillMatchingAlgorithm_Jaffna()
{
// arange
int seekerId = 1073;
int seekerId = 4;
Coordinate seekerLocation = new Coordinate { Longitude = 80.005974, Latitude = 9.661623 };

// Act
Expand All @@ -165,7 +169,7 @@ public async Task TestSkillMatchingAlgorithm_Jaffna()
public async Task TestSkillMatchingAlgorithm_ForSeekerSkills_Colombo()
{
// arange
int seekerId = 1073;
int seekerId = 4;
Coordinate seekerLocation = new Coordinate { Longitude = 79.861244, Latitude = 6.927079 };

// Act
Expand All @@ -176,7 +180,7 @@ public async Task TestSkillMatchingAlgorithm_ForSeekerSkills_Colombo()
public async Task IsExpired_ReturnsTrue_WhenAdvertisementIsExpired()
{
// Act
var result = await _advertisementService.IsExpired(1057);
var result = await _advertisementService.IsExpired(1);

// Assert
Assert.True(result);
Expand All @@ -186,7 +190,7 @@ public async Task IsExpired_ReturnsTrue_WhenAdvertisementIsExpired()
public async Task IsExpired_ReturnsFalse_WhenAdvertisementIsNotExpired()
{
// Act
var result = await _advertisementService.IsExpired(1055);
var result = await _advertisementService.IsExpired(2);

// Assert
Assert.False(result);
Expand Down

0 comments on commit de203eb

Please sign in to comment.