Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjfirth committed Aug 19, 2024
1 parent fdf6264 commit b9f8a5d
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dfe.ContentSupport.Web.Common;
using Contentful.Core.Models;
using Dfe.ContentSupport.Web.Common;
using Dfe.ContentSupport.Web.Configuration;
using Dfe.ContentSupport.Web.Models;
using Dfe.ContentSupport.Web.Models.Mapped;
Expand Down Expand Up @@ -28,11 +29,11 @@ public class CustomAccordionTests
InternalName = InternalName,
Title = Title,
SummaryLine = SummaryLine,
Sys = new Sys
SystemProperties = new SystemProperties
{
ContentType = new ContentType
ContentType = new Contentful.Core.Models.ContentType
{
Sys = new Sys
SystemProperties = new SystemProperties
{
Id = ContentId
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ public class CustomAttachmentTests
{
InternalName = InternalName,
Title = Title,
Sys = new Sys
SystemProperties = new SystemProperties
{
ContentType = new ContentType
ContentType = new Contentful.Core.Models.ContentType
{
Sys = new Sys

SystemProperties = new SystemProperties
{
Id = ContentId
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ public class CustomCardTests
Meta = Meta,
ImageAlt = ImageAlt,
Description = Description,
Sys = new Sys
SystemProperties = new Contentful.Core.Models.SystemProperties
{
ContentType = new ContentType
ContentType = new Contentful.Core.Models.ContentType
{
Sys = new Sys
SystemProperties = new Contentful.Core.Models.SystemProperties
{
Id = ContentId
Id = "csCard"
}
}
},
Expand All @@ -52,10 +52,10 @@ public class CustomCardTests
{
Url = ImageUri
}
}
},
}
}
}
},
},
};

[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dfe.ContentSupport.Web.Common;
using Contentful.Core.Models;
using Dfe.ContentSupport.Web.Common;
using Dfe.ContentSupport.Web.Configuration;
using Dfe.ContentSupport.Web.Models;
using Dfe.ContentSupport.Web.Models.Mapped.Custom;
Expand Down Expand Up @@ -31,11 +32,12 @@ public class CustomGridContainerTests
Meta = CardMeta,
ImageAlt = CardImageAlt,
Description = CardDescription,
Sys = new Sys
SystemProperties = new SystemProperties
{
ContentType = new ContentType
ContentType = new Contentful.Core.Models.ContentType
{
Sys = new Sys

SystemProperties = new SystemProperties
{
Id = CardContentId
}
Expand All @@ -45,7 +47,7 @@ public class CustomGridContainerTests
{
Fields = new Fields
{
File = new FileDetails
File = new Web.Models.FileDetails
{
Url = CardImageUri
}
Expand All @@ -61,11 +63,11 @@ public class CustomGridContainerTests
Target = new Target
{
InternalName = ContainerInternalName,
Sys = new Sys
SystemProperties = new Contentful.Core.Models.SystemProperties
{
ContentType = new ContentType
ContentType = new Contentful.Core.Models.ContentType
{
Sys = new Sys
SystemProperties = new Contentful.Core.Models.SystemProperties
{
Id = ContainerContentId
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dfe.ContentSupport.Web.Common;
using Contentful.Core.Models;
using Dfe.ContentSupport.Web.Common;
using Dfe.ContentSupport.Web.Configuration;
using Dfe.ContentSupport.Web.Models;
using Dfe.ContentSupport.Web.Models.Mapped.Standard;
Expand All @@ -22,7 +23,7 @@ public class EmbeddedEntryTests
{
InternalName = InternalName,
JumpIdentifier = JumpIdentifier,
Sys = new Sys()
SystemProperties = new SystemProperties()
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public class ContentServiceTests
{
Items = new List<ContentSupportPage>
{
new() { Slug = "slug1", IsSitemap = true, Sys = new Sys() },
new() { Slug = "slug2", IsSitemap = false, Sys = new Sys() },
new() { Slug = "slug3", IsSitemap = true, Sys = new Sys() }
new() { Slug = "slug1", IsSitemap = true, SystemProperties = new SystemProperties() },
new() { Slug = "slug2", IsSitemap = false, SystemProperties = new SystemProperties() },
new() { Slug = "slug3", IsSitemap = true, SystemProperties = new SystemProperties() }
}
};

Expand Down
18 changes: 10 additions & 8 deletions tests/Dfe.ContentSupport.Web.Tests/Services/ModelMapperTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dfe.ContentSupport.Web.Common;
using Contentful.Core.Models;
using Dfe.ContentSupport.Web.Common;
using Dfe.ContentSupport.Web.Configuration;
using Dfe.ContentSupport.Web.Models;
using Dfe.ContentSupport.Web.Models.Mapped;
Expand All @@ -22,15 +23,15 @@ public void MapToCsPages_Return_Correct_Amount()
{
new()
{
Sys = new Sys()
SystemProperties = new SystemProperties()
},
new()
{
Sys = new Sys()
SystemProperties = new SystemProperties()
},
new()
{
Sys = new Sys()
{
SystemProperties = new SystemProperties()
}
};

Expand Down Expand Up @@ -132,11 +133,12 @@ public void UnknownCustom_Returns_Null()
{
var testValue = new Target
{
Sys = new Sys
SystemProperties = new SystemProperties
{
ContentType = new ContentType
ContentType = new Contentful.Core.Models.ContentType
{
Sys = new Sys

SystemProperties = new SystemProperties
{
Id = "DUMMY"
}
Expand Down

0 comments on commit b9f8a5d

Please sign in to comment.