Skip to content

Commit

Permalink
Merge pull request #74 from LBHackney-IT/feature/TS-1401
Browse files Browse the repository at this point in the history
TS-1401: Add AssignedOfficer to TempAccommodationInfo (and IsTemporaryAccommodation to TenuredAsset)
  • Loading branch information
martapederiva authored Apr 25, 2024
2 parents 011a7d1 + b4fab62 commit 206faec
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public void DomainTempAccommodationInfoHasPropertiesSet()

//assert
createdDomaninTAInfo.BookingStatus.Should().Be(aQueryableTAInfo.BookingStatus);
createdDomaninTAInfo.AssignedOfficer.Should().BeEquivalentTo(aQueryableTAInfo.AssignedOfficer);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using FluentAssertions;
using Xunit;
using AutoFixture;
using Hackney.Shared.HousingSearch.Gateways.Models.Tenures;
using Hackney.Shared.HousingSearch.Domain.Tenure;

namespace Hackney.Shared.HousingSearch.Tests
{
public class TemporaryAccommodationOfficerTests
{
private Fixture _fixture = new Fixture();

[Fact]
public void DomainTAOfficerHasPropertiesSet()
{
//arrange
var aQueryableTAOfficer = _fixture.Create<QueryableTempAccommodationOfficer>();

//act
var createdDomaninTAOfficer = TempAccommodationOfficer.Create(aQueryableTAOfficer);

//assert
createdDomaninTAOfficer.FirstName.Should().Be(aQueryableTAOfficer.FirstName);
createdDomaninTAOfficer.LastName.Should().Be(aQueryableTAOfficer.LastName);
createdDomaninTAOfficer.Email.Should().Be(aQueryableTAOfficer.Email);
}
}
}
30 changes: 30 additions & 0 deletions Hackney.Shared.HousingSearch.Tests/Models/TenuredAssetTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using FluentAssertions;
using Xunit;
using AutoFixture;
using Hackney.Shared.HousingSearch.Gateways.Models.Tenures;
using Hackney.Shared.HousingSearch.Domain.Tenure;

namespace Hackney.Shared.HousingSearch.Tests
{
public class TenuredAssetTests
{
private Fixture _fixture = new Fixture();

[Fact]
public void DomainTenuredAssetHasPropertiesSet()
{
//arrange
var aQueryableTenuredAsset = _fixture.Create<QueryableTenuredAsset>();

//act
var createdDomainTenuredAsset = TenuredAsset.Create(aQueryableTenuredAsset);

//assert
createdDomainTenuredAsset.FullAddress.Should().Be(aQueryableTenuredAsset.FullAddress);
createdDomainTenuredAsset.Uprn.Should().Be(aQueryableTenuredAsset.Uprn);
createdDomainTenuredAsset.Id.Should().Be(aQueryableTenuredAsset.Id);
createdDomainTenuredAsset.Type.Should().Be(aQueryableTenuredAsset.Type);
createdDomainTenuredAsset.IsTemporaryAccommodation.Should().Be(aQueryableTenuredAsset.IsTemporaryAccommodation);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Hackney.Shared.HousingSearch.Domain.Tenure
public class TempAccommodationInfo
{
public string BookingStatus { get; set; }
public QueryableTempAccommodationOfficer AssignedOfficer { get; set; }

public static TempAccommodationInfo Create(QueryableTempAccommodationInfo TempAccommodationInfo)
{
Expand All @@ -17,6 +18,7 @@ public TempAccommodationInfo()
private TempAccommodationInfo(QueryableTempAccommodationInfo TempAccommodationInfo)
{
BookingStatus = TempAccommodationInfo?.BookingStatus;
AssignedOfficer = TempAccommodationInfo?.AssignedOfficer;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Hackney.Shared.HousingSearch.Gateways.Models.Tenures;

namespace Hackney.Shared.HousingSearch.Domain.Tenure
{
public class TempAccommodationOfficer
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }

public static TempAccommodationOfficer Create(QueryableTempAccommodationOfficer TempAccommodationOfficer)
{
return new TempAccommodationOfficer(TempAccommodationOfficer);
}
public TempAccommodationOfficer()
{

}
private TempAccommodationOfficer(QueryableTempAccommodationOfficer TAOfficer)
{
FirstName = TAOfficer?.FirstName;
LastName = TAOfficer?.LastName;
Email = TAOfficer?.Email;
}
}
}


2 changes: 2 additions & 0 deletions Hackney.Shared.HousingSearch/Domain/Tenure/TenuredAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class TenuredAsset
public string Uprn { get; set; }
public string Id { get; set; }
public string Type { get; set; }
public bool? IsTemporaryAccommodation { get; set; }

public static TenuredAsset Create(QueryableTenuredAsset tenuredAsset)
{
Expand All @@ -25,6 +26,7 @@ private TenuredAsset(QueryableTenuredAsset tenuredAsset)
Uprn = tenuredAsset?.Uprn;
Id = tenuredAsset?.Id;
Type = tenuredAsset?.Type;
IsTemporaryAccommodation = tenuredAsset?.IsTemporaryAccommodation;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ namespace Hackney.Shared.HousingSearch.Gateways.Models.Tenures
public class QueryableTempAccommodationInfo
{
public string BookingStatus { get; set; }
public QueryableTempAccommodationOfficer AssignedOfficer { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Hackney.Shared.HousingSearch.Gateways.Models.Tenures
{
public class QueryableTempAccommodationOfficer
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ public class QueryableTenuredAsset
public string Uprn { get; set; }
public string Id { get; set; }
public string Type { get; set; }
public bool? IsTemporaryAccommodation { get; set; }
}
}

0 comments on commit 206faec

Please sign in to comment.