@ -19,30 +19,33 @@ public class ContentParser_Test : CmsKitDomainTestBase
}
[Fact]
public async Task AA_ParseAsync_ShouldWorkMoreDynamically ( )
public async Task ParseAsync_ShouldWorkWithDifferentWidgetTypes ( )
{
_ options . Value . AddWidgetConfig ( testData . PollName , new ContentWidgetConfig ( testData . WidgetName ) ) ;
_ options . Value . AddWidgetConfig ( "ImageGallery" , new ContentWidgetConfig ( "ImageGallery" ) ) ; //test
contentParser = new ContentParser ( _ options ) ;
var content = @ "**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type=""Poll"" PollName =""poll-name""]
[Widget Type=""Poll"" Code =""poll-name""]
Thanks _f or_ * your * feedback .
[Widget Type=""ImageGallery"" GalleryName=""Xyz "" Source=""GoogleDrive""] ";
[Widget GalleryName=""Xyz"" Type=""ImageGallery "" Source=""GoogleDrive""] ";
var widgets = await contentParser . ParseAsync ( content ) ;
widgets . ShouldNotBeNull ( ) ;
widgets . Count . ShouldBe ( 4 ) ;
widgets [ 1 ] . ExtraProperties . Count . ShouldBe ( 2 ) ;
widgets [ 3 ] . ExtraProperties . Count . ShouldBe ( 3 ) ;
}
[Fact]
public async Task ParseAsync_ShouldWorkWithoutConfigOptions ( )
{
var content = @ "**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type= ""Poll"" PollNam e =""poll-name""]
[Widget Type= ""Poll"" Cod e =""poll-name""]
Thanks _f or_ * your * feedback . ";
contentParser = new ContentParser ( _ options ) ;
var widgets = await contentParser . ParseAsync ( content ) ;
widgets . ShouldNotBeNull ( ) ;
@ -56,7 +59,7 @@ public class ContentParser_Test : CmsKitDomainTestBase
contentParser = new ContentParser ( _ options ) ;
var content = @ "**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type= ""Poll"" PollNam e =""poll-name""]
[Widget Type= ""Poll"" Cod e =""poll-name""]
Thanks _f or_ * your * feedback . ";
var widgets = await contentParser . ParseAsync ( content ) ;
@ -72,7 +75,7 @@ public class ContentParser_Test : CmsKitDomainTestBase
contentParser = new ContentParser ( _ options ) ;
var content = @ "**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Wrong Type= ""Poll"" PollNam e =""poll-name""]
[Widget Wrong Type= ""Poll"" Cod e =""poll-name""]
Thanks _f or_ * your * feedback . ";
var widgets = await contentParser . ParseAsync ( content ) ;
@ -88,13 +91,13 @@ public class ContentParser_Test : CmsKitDomainTestBase
contentParser = new ContentParser ( _ options ) ;
var content = @ "**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type= ""Poll"" PollWrongName =""poll-name""]
[Widget Type= ""Poll"" PollWrongName =""poll-name""]
Thanks _f or_ * your * feedback . ";
var widgets = await contentParser . ParseAsync ( content ) ;
widgets . ShouldNotBeNull ( ) ;
widgets . Count . ShouldBe ( 2 ) ;
widgets . Count . ShouldBe ( 3 ) ;
}
[Theory]
@ -114,19 +117,19 @@ public class ContentParser_Test : CmsKitDomainTestBase
new List < object [ ] >
{
new object [ ] { @ "**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type=""Poll"" PollNam e=""poll-name""]
[Widget Type=""Poll"" Cod e=""poll-name""]
Thanks _f or_ * your * feedback . ", 3},
new object [ ] { @ "**ABP Framework** is completely open source and developed in a community-driven manner.
[Widget Type=""Poll"" PollNam e=""poll-name""]
[Widget Type=""Poll"" Cod e=""poll-name""]
Thanks _f or_ * your * feedback .
[Widget Type=""Poll"" PollNam e=""poll-name1""] ", 4 },
[Widget Type=""Poll"" Cod e=""poll-name1""] ", 4 },
new object [ ] { @ "**ABP Framework** is completely open source and developed in a community-driven manner.
Thanks _f or_ * your * feedback .
[Widget Type=""Poll"" PollNam e=""poll-name""] ", 2 },
[Widget Type=""Poll"" Cod e=""poll-name""] ", 2 },
new object [ ] { @"[Widget Type=""Poll"" PollName=""poll-name""] gg [Widget Type=""Poll"" PollNam e=""poll-name1" "]**ABP Framework** is completely open source and developed in a community-driven manner.
new object [ ] { @"[Widget Type=""Poll"" Code=""poll-name""] gg [Widget Type=""Poll"" Cod e=""poll-name1" "]**ABP Framework** is completely open source and developed in a community-driven manner.
Thanks _f or_ * your * feedback .
Thanks _f or_ * your * feedback . ", 4},