diff --git a/Mockaco.sln b/Mockaco.sln
index 4c7c701..9298c93 100644
--- a/Mockaco.sln
+++ b/Mockaco.sln
@@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mockaco.Tests", "test\Mockaco.Tests\Mockaco.Tests.csproj", "{EE57B1B4-29D2-4AE3-8F23-5E622302C30F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mockaco.AspNetCore", "src\Mockaco.AspNetCore\Mockaco.AspNetCore.csproj", "{7766C592-9887-4162-8B9C-51003ED30335}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mockaco.AspNetCore", "src\Mockaco.AspNetCore\Mockaco.AspNetCore.csproj", "{7766C592-9887-4162-8B9C-51003ED30335}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -27,14 +27,14 @@ Global
{8BAA1EC5-0BF5-4DA2-87F7-ED0C7B652517}.Nuget|Any CPU.Build.0 = Nuget|Any CPU
{8BAA1EC5-0BF5-4DA2-87F7-ED0C7B652517}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8BAA1EC5-0BF5-4DA2-87F7-ED0C7B652517}.Release|Any CPU.Build.0 = Release|Any CPU
- {EE57B1B4-29D2-4AE3-8F23-5E622302C30F}.Debug|Any CPU.ActiveCfg = Release|Any CPU
+ {EE57B1B4-29D2-4AE3-8F23-5E622302C30F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EE57B1B4-29D2-4AE3-8F23-5E622302C30F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE57B1B4-29D2-4AE3-8F23-5E622302C30F}.Nuget|Any CPU.ActiveCfg = Release|Any CPU
- {EE57B1B4-29D2-4AE3-8F23-5E622302C30F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EE57B1B4-29D2-4AE3-8F23-5E622302C30F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EE57B1B4-29D2-4AE3-8F23-5E622302C30F}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{7766C592-9887-4162-8B9C-51003ED30335}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7766C592-9887-4162-8B9C-51003ED30335}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7766C592-9887-4162-8B9C-51003ED30335}.Nuget|Any CPU.ActiveCfg = Debug|Any CPU
- {7766C592-9887-4162-8B9C-51003ED30335}.Nuget|Any CPU.Build.0 = Debug|Any CPU
+ {7766C592-9887-4162-8B9C-51003ED30335}.Nuget|Any CPU.ActiveCfg = Release|Any CPU
+ {7766C592-9887-4162-8B9C-51003ED30335}.Nuget|Any CPU.Build.0 = Release|Any CPU
{7766C592-9887-4162-8B9C-51003ED30335}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7766C592-9887-4162-8B9C-51003ED30335}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
diff --git a/test/Mockaco.Tests/Mockaco.Tests.csproj b/test/Mockaco.Tests/Mockaco.Tests.csproj
index 996a800..5a67eec 100644
--- a/test/Mockaco.Tests/Mockaco.Tests.csproj
+++ b/test/Mockaco.Tests/Mockaco.Tests.csproj
@@ -5,24 +5,10 @@
false
-
-
-
-
-
-
Always
-
- Always
- PreserveNewest
-
-
- PreserveNewest
- Always
-
@@ -45,4 +31,15 @@
+
+
+ PreserveNewest
+ Always
+
+
+ Always
+ PreserveNewest
+
+
+
diff --git a/test/Mockaco.Tests/Templating/Scripting/ScriptRunnerFactoryTest.cs b/test/Mockaco.Tests/Templating/Scripting/ScriptRunnerFactoryTest.cs
new file mode 100644
index 0000000..c6c74e9
--- /dev/null
+++ b/test/Mockaco.Tests/Templating/Scripting/ScriptRunnerFactoryTest.cs
@@ -0,0 +1,33 @@
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using Moq;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Xunit;
+
+namespace Mockaco.Tests.Templating.Scripting
+{
+ public class ScriptRunnerFactoryTest
+ {
+ [Theory]
+ [InlineData(@"JsonConvert.SerializeObject(new DateTime(2012, 04, 23, 18, 25, 43, 511, DateTimeKind.Utc))", @"\""2012-04-23T18:25:43\.511Z\""")]
+ [InlineData(@"new PhoneNumbers().BrazilianPhoneNumber()", @"[0-9]+")]
+ [InlineData(@"new Faker().Random.Guid().ToString()", @"[a-z0-9\-]+")]
+ [InlineData(@"new Regex(@"".*"").IsMatch(""abc"").ToString()", @"True")]
+ [InlineData(@"new[] {1, 2, 3, 4, 5, 6, 7}.Count().ToString()", @"7")]
+ public async Task Can_Run_Scripts_From_Builtin_Namespaces(string input, string regexPattern)
+ {
+ var mockLogger = Moq.Mock.Of>();
+ var mockOptions = Moq.Mock.Of>(o => o.CurrentValue == new MockacoOptions());
+
+ var runner = new ScriptRunnerFactory(mockLogger, mockOptions);
+
+ var result = await runner.Invoke("", input);
+
+ Assert.Matches(regexPattern, result);
+ }
+ }
+}