Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/azure-pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
cafour committed May 6, 2021
2 parents 0201381 + 0094a5d commit 94f02ae
Show file tree
Hide file tree
Showing 145 changed files with 3,101 additions and 1,567 deletions.
4 changes: 2 additions & 2 deletions src/DotVVM.CommandLine/DotVVM.CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<PropertyGroup>
<AssemblyTitle>DotVVM.CommandLine</AssemblyTitle>
<AssemblyName>dotnet-dotvvm</AssemblyName>
<VersionPrefix>3.0.0</VersionPrefix>
<VersionPrefix>3.0.2</VersionPrefix>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyOriginatorKeyFile>dotvvmwizard.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PackAsTool>true</PackAsTool>
<ToolCommandName>dotvvm</ToolCommandName>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PackageId>DotVVM.CommandLine</PackageId>
<PackageVersion>3.0.0</PackageVersion>
<PackageVersion>3.0.2</PackageVersion>
<Authors>RIGANTI</Authors>
<Description>Command-line tools for DotVVM.</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down
6 changes: 3 additions & 3 deletions src/DotVVM.CommandLine/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("3.0.0")]
[assembly: AssemblyVersion("3.0.0")]
[assembly: AssemblyFileVersion("3.0.0")]
// [assembly: AssemblyVersion("3.0.2")]
[assembly: AssemblyVersion("3.0.2")]
[assembly: AssemblyFileVersion("3.0.2")]
4 changes: 2 additions & 2 deletions src/DotVVM.Compiler.Light/DotVVM.Compiler.Light.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>3.0.0</VersionPrefix>
<VersionPrefix>3.0.2</VersionPrefix>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>dotnet-dotvvm-compiler</AssemblyName>
<PackageId>DotVVM.Compiler.Light</PackageId>
<PackageVersion>3.0.0</PackageVersion>
<PackageVersion>3.0.2</PackageVersion>
<Authors>RIGANTI</Authors>
<Description>Command-line compiler for DotVVM.</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down
4 changes: 2 additions & 2 deletions src/DotVVM.Compiler.Light/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.0")]
[assembly: AssemblyFileVersion("3.0.0")]
[assembly: AssemblyVersion("3.0.2")]
[assembly: AssemblyFileVersion("3.0.2")]
4 changes: 2 additions & 2 deletions src/DotVVM.Core/DotVVM.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>3.0.0</VersionPrefix>
<VersionPrefix>3.0.2</VersionPrefix>
<TargetFrameworks>netstandard1.6;net451</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -17,7 +17,7 @@
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<PackageId>DotVVM.Core</PackageId>
<PackageVersion>3.0.0</PackageVersion>
<PackageVersion>3.0.2</PackageVersion>
<Authors>RIGANTI</Authors>
<Description>This package contains base classes and interfaces of DotVVM that might be useful in a business layer.
DotVVM is an open source ASP.NET-based framework which allows to build modern web apps without writing any JavaScript code.</Description>
Expand Down
6 changes: 3 additions & 3 deletions src/DotVVM.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("3.0.0")]
[assembly: AssemblyVersion("3.0.0")]
[assembly: AssemblyFileVersion("3.0.0")]
// [assembly: AssemblyVersion("3.0.2")]
[assembly: AssemblyVersion("3.0.2")]
[assembly: AssemblyFileVersion("3.0.2")]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>DotVVM.Api.Swashbuckle.AspNetCore</PackageId>
<PackageVersion>3.0.0</PackageVersion>
<PackageVersion>3.0.2</PackageVersion>
<Authors>RIGANTI</Authors>
<Description>Swashbuckle.AspNetCore extensions for DotVVM.</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net451</TargetFramework>
<PackageId>DotVVM.Api.Swashbuckle.Owin</PackageId>
<PackageVersion>3.0.0</PackageVersion>
<PackageVersion>3.0.2</PackageVersion>
<Authors>RIGANTI</Authors>
<Description>Swashbuckle.Owin extensions for DotVVM.</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>3.0.0</VersionPrefix>
<VersionPrefix>3.0.2</VersionPrefix>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -17,7 +17,7 @@
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<PackageId>DotVVM.AspNetCore</PackageId>
<PackageVersion>3.0.0</PackageVersion>
<PackageVersion>3.0.2</PackageVersion>
<Authors>RIGANTI</Authors>
<Description>
This package contains ASP.NET Core middleware and hosting infrastructure for DotVVM apps. It supports both .NET Framework and .NET Core.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("3.0.0")]
[assembly: AssemblyFileVersion("3.0.0")]
[assembly: AssemblyVersion("3.0.2")]
[assembly: AssemblyFileVersion("3.0.2")]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c5af6a0d-5416-44d4-b14d-8ffdd1b0e99b")]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>3.0.0</VersionPrefix>
<VersionPrefix>3.0.2</VersionPrefix>
<TargetFramework>net451</TargetFramework>
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -17,7 +17,7 @@
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<PackageId>DotVVM.Owin</PackageId>
<PackageVersion>3.0.0</PackageVersion>
<PackageVersion>3.0.2</PackageVersion>
<Authors>RIGANTI</Authors>
<Description>
This package contains OWIN middleware and hosting infrastructure for DotVVM apps.
Expand Down
4 changes: 2 additions & 2 deletions src/DotVVM.Framework.Hosting.Owin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("3.0.0")]
[assembly: AssemblyFileVersion("3.0.0")]
[assembly: AssemblyVersion("3.0.2")]
[assembly: AssemblyFileVersion("3.0.2")]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6DACF57C-91E9-4B2B-AF54-F09989BD8ED6")]
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,88 @@ public void BindingCompiler_Valid_StringLiteralInSingleQuotes()
Assert.AreEqual(ExecuteBinding("StringProp + 'def'", viewModel), "abcdef");
}

[TestMethod]
[DataRow(@"$'Non-Interpolated'", "Non-Interpolated")]
[DataRow(@"$'Non-Interpolated {{'", "Non-Interpolated {")]
[DataRow(@"$'Non-Interpolated {{ no-expression }}'", "Non-Interpolated { no-expression }")]
public void BindingCompiler_Valid_InterpolatedString_NoExpressions(string expression, string evaluated)
{
var binding = ExecuteBinding(expression);
Assert.AreEqual(evaluated, binding);
}

[TestMethod]
[DataRow(@"$'} Malformed'", "Unexpected token '$' ---->}<----")]
[DataRow(@"$'{ Malformed'", "Could not find matching closing character '}' for an interpolated expression")]
[DataRow(@"$'Malformed {expr'", "Could not find matching closing character '}' for an interpolated expression")]
[DataRow(@"$'Malformed expr}'", "Unexpected token '$'Malformed expr ---->}<---- ")]
[DataRow(@"$'Malformed {'", "Could not find matching closing character '}' for an interpolated expression")]
[DataRow(@"$'Malformed }'", "Unexpected token '$'Malformed ---->}<----")]
[DataRow(@"$'Malformed {}'", "Expected expression, but instead found empty")]
[DataRow(@"$'Malformed {StringProp; IntProp}'", "Expected end of interpolated expression, but instead found Semicolon")]
[DataRow(@"$'Malformed {(string arg) => arg.Length}'", "Expected end of interpolated expression, but instead found Identifier")]
[DataRow(@"$'Malformed {(StringProp == null) ? 'StringPropWasNull' : 'StringPropWasNotNull'}'", "Conditional expression needs to be enclosed in parentheses")]
public void BindingCompiler_Invalid_InterpolatedString_MalformedExpression(string expression, string errorMessage)
{
try
{
ExecuteBinding(expression);
}
catch (Exception e)
{
// Get inner-most exception
var current = e;
while (current.InnerException != null)
current = current.InnerException;

Assert.AreEqual(typeof(BindingCompilationException), current.GetType());
StringAssert.Contains(current.Message, errorMessage);
}
}

[TestMethod]
[DataRow(@"$""Interpolated {StringProp} {StringProp}""", "Interpolated abc abc")]
[DataRow(@"$'Interpolated {StringProp} {StringProp}'", "Interpolated abc abc")]
[DataRow(@"$'Interpolated {StringProp.Length}'", "Interpolated 3")]
public void BindingCompiler_Valid_InterpolatedString_WithSimpleExpressions(string expression, string evaluated)
{
var viewModel = new TestViewModel() { StringProp = "abc" };
var binding = ExecuteBinding(expression, viewModel);
Assert.AreEqual(evaluated, binding);
}

[TestMethod]
[DataRow(@"$'{string.Join(', ', IntArray)}'", "1, 2, 3")]
[DataRow(@"$'{string.Join(', ', 'abc', 'def', $'{string.Join(', ', IntArray)}')}'", "abc, def, 1, 2, 3")]
public void BindingCompiler_Valid_InterpolatedString_NestedExpressions(string expression, string evaluated)
{
var viewModel = new TestViewModel { IntArray = new[] { 1, 2, 3 } };
var binding = ExecuteBinding(expression, viewModel);
Assert.AreEqual(evaluated, binding);
}

[TestMethod]
[DataRow(@"$'Interpolated {IntProp < LongProperty}'", "Interpolated True")]
[DataRow(@"$'Interpolated {StringProp ?? 'StringPropWasNull'}'", "Interpolated StringPropWasNull")]
[DataRow(@"$'Interpolated {((StringProp == null) ? 'StringPropWasNull' : 'StringPropWasNotNull')}'", "Interpolated StringPropWasNull")]
public void BindingCompiler_Valid_InterpolatedString_WithComplexExpressions(string expression, string evaluated)
{
var viewModel = new TestViewModel() { IntProp = 1, LongProperty = 2 };
var binding = ExecuteBinding(expression, viewModel);
Assert.AreEqual(evaluated, binding);
}

[TestMethod]
[DataRow(@"$'Interpolated {DateFrom:R}'", "Interpolated Fri, 11 Nov 2011 12:11:11 GMT")]
[DataRow(@"$'Interpolated {$'{DateFrom:R}'}'", "Interpolated Fri, 11 Nov 2011 12:11:11 GMT")]
[DataRow(@"$'Interpolated {$'{IntProp:0000}'}'", "Interpolated 0006")]
public void BindingCompiler_Valid_InterpolatedString_WithFormattingComponent(string expression, string evaluated)
{
var viewModel = new TestViewModel() { DateFrom = DateTime.Parse("2011-11-11T11:11:11+00:00"), IntProp = 6 };
var binding = ExecuteBinding(expression, viewModel);
Assert.AreEqual(evaluated, binding);
}

[TestMethod]
public void BindingCompiler_Valid_PropertyProperty()
{
Expand Down Expand Up @@ -647,6 +729,7 @@ class TestViewModel
{
public string StringProp { get; set; }
public int IntProp { get; set; }
public double DoubleProp { get; set; }
public TestViewModel2 TestViewModel2 { get; set; }
public TestViewModel2 TestViewModel2B { get; set; }
public TestEnum EnumProperty { get; set; }
Expand All @@ -659,6 +742,7 @@ class TestViewModel
public long LongProperty { get; set; }

public long[] LongArray => new long[] { 1, 2, long.MaxValue };
public string[] StringArray => new string[] { "Hello ", "DotVVM" };
public TestViewModel2[] VmArray => new TestViewModel2[] { new TestViewModel2() };
public int[] IntArray { get; set; }

Expand Down
43 changes: 43 additions & 0 deletions src/DotVVM.Framework.Tests.Common/Binding/ExpressionHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,22 @@ public void Call_FindOverload_Generic_Enumerable_Array(Type resultIdentifierType
Call_FindOverload_Generic(typeof(MethodsGenericArgumentsResolvingSampleObject6), MethodsGenericArgumentsResolvingSampleObject6.MethodName, argTypes, resultIdentifierType, expectedGenericArgs);
}
[TestMethod]
[DataRow(typeof(GenericTestResult1), new Type[] { typeof(List<int>), typeof(GenericInterfaceIntImplementation) }, new Type[] { typeof(int) })]
[DataRow(typeof(GenericTestResult1), new Type[] { typeof(List<int>), typeof(GenericInterfaceFloatImplementation) }, new Type[] { typeof(float) })]
[DataRow(typeof(GenericTestResult2), new Type[] { typeof(List<int>), typeof(DerivedFromGenericClassInt) }, new Type[] { typeof(int) })]
[DataRow(typeof(GenericTestResult3), new Type[] { typeof(List<int>), typeof(MultiGenericInterfaceImplementation) }, new Type[] { typeof(int), typeof(string) })]
[DataRow(typeof(GenericTestResult3), new Type[] { typeof(List<int>), typeof(GenericInterfaceStringImplementation) }, new Type[] { typeof(string) })]
[DataRow(typeof(GenericTestResult4), new Type[] { typeof(List<int>), typeof(DerivedFromGenericClassString) }, new Type[] { typeof(string) })]
[DataRow(typeof(GenericTestResult5), new Type[] { typeof(List<int>), typeof(GenericInterfaceIntImplementation), typeof(GenericInterfaceStringImplementation) }, new Type[] { typeof(int), typeof(string) })]
[DataRow(typeof(GenericTestResult6), new Type[] { typeof(List<int>), typeof(GenericInterfaceIntImplementation), typeof(GenericInterfaceFloatImplementation) }, new Type[] { typeof(int) })]
[DataRow(typeof(GenericTestResult7), new Type[] { typeof(List<GenericInterfaceIntImplementation>) }, new Type[] { typeof(int) })]
[DataRow(typeof(GenericTestResult7), new Type[] { typeof(HashSet<GenericInterfaceIntImplementation>) }, new Type[] { typeof(int) })]
[DataRow(typeof(GenericTestResult8), new Type[] { typeof(List<GenericInterfaceStringImplementation>) }, new Type[] { typeof(string) })]
public void Call_FindOverload_Generic_ImplicitConversions(Type resultIdentifierType, Type[] argTypes, Type[] expectedGenericArgs)
{
Call_FindOverload_Generic(typeof(ImplicitConversionsTest), nameof(ImplicitConversionsTest.Method), argTypes, resultIdentifierType, expectedGenericArgs);
}
[TestMethod]
[DataRow(typeof(GenericTestResult1), new Type[] { typeof(GenericModelSampleObject<int[]>) }, new Type[] { typeof(int) })]
[DataRow(typeof(GenericTestResult2), new Type[] { typeof(List<int>[]) }, new Type[] { typeof(int) })]
public void Call_FindOverload_Generic_Array_Recursive(Type resultIdentifierType, Type[] argTypes, Type[] expectedGenericArgs)
Expand Down Expand Up @@ -322,6 +338,9 @@ public class GenericTestResult2 { }
public class GenericTestResult3 { }
public class GenericTestResult4 { }
public class GenericTestResult5 { }
public class GenericTestResult6 { }
public class GenericTestResult7 { }
public class GenericTestResult8 { }

public class ParamsPrioritizationTest
{
Expand All @@ -331,4 +350,28 @@ public class ParamsPrioritizationTest
public static (string, int[]) Method(string arg1, params int[] arg2) => default;
public static (string, object) Method(string arg1, object arg2) => default;
}

public interface GenericInterface<T> { }
public class GenericClass<T> { }
public class GenericInterfaceIntImplementation : GenericInterface<int> { }
public class GenericInterfaceFloatImplementation : GenericInterface<float> { }
public class GenericInterfaceStringImplementation : GenericInterface<string> { }
public class MultiGenericInterfaceImplementation : GenericInterface<float>, GenericInterface<string> { }
public class DerivedFromGenericClassInt : GenericClass<int> { }
public class DerivedFromGenericClassString : GenericClass<string> { }

public class ImplicitConversionsTest
{
public static GenericTestResult1 Method<T>(List<int> arg1, GenericInterface<T> arg2) => default;
public static GenericTestResult2 Method<T>(List<int> arg1, GenericClass<T> arg2) => default;

public static GenericTestResult3 Method(List<int> arg1, GenericInterface<string> arg2) => default;
public static GenericTestResult4 Method(List<int> arg1, GenericClass<string> arg2) => default;

public static GenericTestResult5 Method<T, U>(List<int> arg1, GenericInterface<T> arg2, GenericInterface<U> arg3) => default;
public static GenericTestResult6 Method<T>(List<int> arg1, GenericInterface<T> arg2, GenericInterface<float> arg3) => default;

public static GenericTestResult7 Method<T>(IEnumerable<GenericInterface<T>> arg1) => default;
public static GenericTestResult8 Method(IEnumerable<GenericInterface<string>> arg1) => default;
}
}
Loading

0 comments on commit 94f02ae

Please sign in to comment.