зеркало из https://github.com/AvaloniaUI/OmniXAML.git
Removed dependency: RESX files for tests
This commit is contained in:
Родитель
5037307315
Коммит
5e54947837
28
OmniXaml.sln
28
OmniXaml.sln
|
@ -1,27 +1,27 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
VisualStudioVersion = 14.0.25123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml", "Source\OmniXaml\OmniXaml.csproj", "{0D9CC1DE-84C3-40D7-9CC5-B7751E0B25D1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Tests", "Tests\OmniXaml.Tests\OmniXaml.Tests.csproj", "{4A7491E9-E218-45F5-BF42-430247765630}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Tests", "Source\OmniXaml.Tests\OmniXaml.Tests.csproj", "{4A7491E9-E218-45F5-BF42-430247765630}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{FCCAF8EF-B08E-4442-90B6-A41903CFB93A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Tests.Classes", "Tests\OmniXaml.Tests.Classes\OmniXaml.Tests.Classes.csproj", "{E6FDA529-90C2-4DDA-9080-7E7EEF64B2CA}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Testing.Classes", "Source\OmniXaml.Tests.Classes\OmniXaml.Testing.Classes.csproj", "{E6FDA529-90C2-4DDA-9080-7E7EEF64B2CA}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xaml.Tests.Resources", "Tests\Xaml.Tests.Resources\Xaml.Tests.Resources.csproj", "{9B517520-4D99-4BF5-8219-A643F718F6DD}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Testing.Resources", "Source\Xaml.Tests.Resources\OmniXaml.Testing.Resources.csproj", "{9B517520-4D99-4BF5-8219-A643F718F6DD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Services.Tests", "Tests\OmniXaml.Services.Tests\OmniXaml.Services.Tests.csproj", "{BB3EEE9D-9962-4ADB-954A-E070B0C03CC8}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Services.Tests", "Source\OmniXaml.Services.Tests\OmniXaml.Services.Tests.csproj", "{BB3EEE9D-9962-4ADB-954A-E070B0C03CC8}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Services.DotNetFx", "Source\OmniXaml.Services.DotNetFx\OmniXaml.Services.DotNetFx.csproj", "{70B12EBB-E332-402E-BAF0-C55F38A6B753}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Tests.Common", "Tests\OmniXaml.Tests.Common\OmniXaml.Tests.Common.csproj", "{03EFD393-33D1-43E6-8835-1450459697F3}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Testing.Common", "Source\OmniXaml.Tests.Common\OmniXaml.Testing.Common.csproj", "{03EFD393-33D1-43E6-8835-1450459697F3}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Wpf", "Source\OmniXaml.Wpf\OmniXaml.Wpf.csproj", "{3F5DEBE4-D1D2-4190-9AEA-FDD4065FDED7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Wpf.Tests", "Tests\OmniXaml.Wpf.Tests\OmniXaml.Wpf.Tests.csproj", "{952C2CB6-BB38-471A-AD55-D68FCAC4A5CF}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Wpf.Tests", "Source\OmniXaml.Wpf.Tests\OmniXaml.Wpf.Tests.csproj", "{952C2CB6-BB38-471A-AD55-D68FCAC4A5CF}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test Applications", "Test Applications", "{1097E760-F02E-433D-ADE6-EC13F9CAEF91}"
|
||||
EndProject
|
||||
|
@ -39,10 +39,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{D4
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{2087C721-53A7-4636-BF02-C1EB0F7378AC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Tests.Common.DotNetFx", "Tests\OmniXaml.Tests.Common.DotNetFx\OmniXaml.Tests.Common.DotNetFx.csproj", "{35EBCD38-4ADA-4860-8F23-6D564C0E4C68}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniXaml.Services.DotNetFx.Tests", "Tests\OmniXaml.Services.DotNetFx.Tests\OmniXaml.Services.DotNetFx.Tests.csproj", "{6DC9D410-E8CA-48A4-8725-697D75F33388}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample WPF App", "TestApplications\TestApplication\Sample WPF App.csproj", "{70FEDBBC-AD3D-4AB9-8EC0-3306BE2E266D}"
|
||||
EndProject
|
||||
Global
|
||||
|
@ -103,14 +99,6 @@ Global
|
|||
{CB1AE182-94D0-425D-BA64-E457378A96BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CB1AE182-94D0-425D-BA64-E457378A96BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CB1AE182-94D0-425D-BA64-E457378A96BE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{35EBCD38-4ADA-4860-8F23-6D564C0E4C68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{35EBCD38-4ADA-4860-8F23-6D564C0E4C68}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{35EBCD38-4ADA-4860-8F23-6D564C0E4C68}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{35EBCD38-4ADA-4860-8F23-6D564C0E4C68}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6DC9D410-E8CA-48A4-8725-697D75F33388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6DC9D410-E8CA-48A4-8725-697D75F33388}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6DC9D410-E8CA-48A4-8725-697D75F33388}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6DC9D410-E8CA-48A4-8725-697D75F33388}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{70FEDBBC-AD3D-4AB9-8EC0-3306BE2E266D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{70FEDBBC-AD3D-4AB9-8EC0-3306BE2E266D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{70FEDBBC-AD3D-4AB9-8EC0-3306BE2E266D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
@ -134,8 +122,6 @@ Global
|
|||
{B207C0CB-2BDF-4105-9E1D-1C5B98E98381} = {D42127E2-3E4B-448C-9481-A31B579FBCEE}
|
||||
{7784DA26-90C9-402E-8AAE-6D4D59C22D74} = {D42127E2-3E4B-448C-9481-A31B579FBCEE}
|
||||
{CB1AE182-94D0-425D-BA64-E457378A96BE} = {1097E760-F02E-433D-ADE6-EC13F9CAEF91}
|
||||
{35EBCD38-4ADA-4860-8F23-6D564C0E4C68} = {A3E121C9-F1A5-468B-940E-BF09C0414DB5}
|
||||
{6DC9D410-E8CA-48A4-8725-697D75F33388} = {FCCAF8EF-B08E-4442-90B6-A41903CFB93A}
|
||||
{70FEDBBC-AD3D-4AB9-8EC0-3306BE2E266D} = {1097E760-F02E-433D-ADE6-EC13F9CAEF91}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -76,17 +76,13 @@
|
|||
<Project>{0D9CC1DE-84C3-40D7-9CC5-B7751E0B25D1}</Project>
|
||||
<Name>OmniXaml</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Classes\OmniXaml.Tests.Classes.csproj">
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Classes\OmniXaml.Testing.Classes.csproj">
|
||||
<Project>{E6FDA529-90C2-4DDA-9080-7E7EEF64B2CA}</Project>
|
||||
<Name>OmniXaml.Tests.Classes</Name>
|
||||
<Name>OmniXaml.Testing.Classes</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Common.DotNetFx\OmniXaml.Tests.Common.DotNetFx.csproj">
|
||||
<Project>{35EBCD38-4ADA-4860-8F23-6D564C0E4C68}</Project>
|
||||
<Name>OmniXaml.Tests.Common.DotNetFx</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Common\OmniXaml.Tests.Common.csproj">
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Common\OmniXaml.Testing.Common.csproj">
|
||||
<Project>{03EFD393-33D1-43E6-8835-1450459697F3}</Project>
|
||||
<Name>OmniXaml.Tests.Common</Name>
|
||||
<Name>OmniXaml.Testing.Common</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
|
@ -36,6 +36,9 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DummyParserFactory.cs" />
|
||||
<Compile Include="GivenAWiringContextNetCore.cs" />
|
||||
<Compile Include="GivenAWiringContextWithNodeBuildersNetCore.cs" />
|
||||
<Compile Include="TestRuntimeTypeSource.cs" />
|
||||
<Compile Include="XamlTypeMock.cs" />
|
||||
<Compile Include="TestTypeRepository.cs" />
|
||||
|
@ -48,9 +51,9 @@
|
|||
<Project>{0D9CC1DE-84C3-40D7-9CC5-B7751E0B25D1}</Project>
|
||||
<Name>OmniXaml</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Classes\OmniXaml.Tests.Classes.csproj">
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Classes\OmniXaml.Testing.Classes.csproj">
|
||||
<Project>{E6FDA529-90C2-4DDA-9080-7E7EEF64B2CA}</Project>
|
||||
<Name>OmniXaml.Tests.Classes</Name>
|
||||
<Name>OmniXaml.Testing.Classes</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
|
@ -41,6 +41,14 @@
|
|||
<HintPath>..\..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PCLStorage, Version=1.0.2.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PCLStorage.1.0.2\lib\net45\PCLStorage.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PCLStorage.Abstractions, Version=1.0.2.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PCLStorage.1.0.2\lib\net45\PCLStorage.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Sprache, Version=2.0.0.51, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Sprache.2.0.0.51\lib\portable-net4+netcore45+win8+wp8+sl5+MonoAndroid+Xamarin.iOS10+MonoTouch\Sprache.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
|
@ -108,21 +116,17 @@
|
|||
<Project>{0D9CC1DE-84C3-40D7-9CC5-B7751E0B25D1}</Project>
|
||||
<Name>OmniXaml</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Classes\OmniXaml.Tests.Classes.csproj">
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Classes\OmniXaml.Testing.Classes.csproj">
|
||||
<Project>{E6FDA529-90C2-4DDA-9080-7E7EEF64B2CA}</Project>
|
||||
<Name>OmniXaml.Tests.Classes</Name>
|
||||
<Name>OmniXaml.Testing.Classes</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Common.DotNetFx\OmniXaml.Tests.Common.DotNetFx.csproj">
|
||||
<Project>{35EBCD38-4ADA-4860-8F23-6D564C0E4C68}</Project>
|
||||
<Name>OmniXaml.Tests.Common.DotNetFx</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Common\OmniXaml.Tests.Common.csproj">
|
||||
<ProjectReference Include="..\OmniXaml.Tests.Common\OmniXaml.Testing.Common.csproj">
|
||||
<Project>{03EFD393-33D1-43E6-8835-1450459697F3}</Project>
|
||||
<Name>OmniXaml.Tests.Common</Name>
|
||||
<Name>OmniXaml.Testing.Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Xaml.Tests.Resources\Xaml.Tests.Resources.csproj">
|
||||
<ProjectReference Include="..\Xaml.Tests.Resources\OmniXaml.Testing.Resources.csproj">
|
||||
<Project>{9B517520-4D99-4BF5-8219-A643F718F6DD}</Project>
|
||||
<Name>Xaml.Tests.Resources</Name>
|
||||
<Name>OmniXaml.Testing.Resources</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
|
@ -10,6 +10,7 @@
|
|||
using OmniXaml.Parsers.ProtoParser;
|
||||
using Resources;
|
||||
using Xaml.Tests.Resources;
|
||||
using File = Xaml.Tests.Resources.File;
|
||||
|
||||
public class FromXamlToInstructions : GivenARuntimeTypeSourceWithNodeBuildersNetCore
|
||||
{
|
||||
|
@ -31,7 +32,7 @@
|
|||
{
|
||||
var expectedInstructions = source.SingleInstance;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.SingleInstance);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\SingleInstance.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -42,7 +43,7 @@
|
|||
{
|
||||
var expectedInstructions = source.SingleInstance;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.RootNamespace);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\RootNamespace.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -53,7 +54,7 @@
|
|||
{
|
||||
var expectedInstructions = source.ObjectWithMember;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.StringProperty);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\StringProperty.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -63,7 +64,7 @@
|
|||
{
|
||||
var expectedInstructions = source.InstanceWithChild;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.InstanceWithChild);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\InstanceWithChild.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -73,7 +74,7 @@
|
|||
{
|
||||
var expectedInstructions = source.DifferentNamespaces;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.DifferentNamespaces);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\DifferentNamespaces.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -83,7 +84,7 @@
|
|||
{
|
||||
var expectedInstructions = source.DifferentNamespacesAndMoreThanOneProperty;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.DifferentNamespacesAndMoreThanOneProperty);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\DifferentNamespacesAndMoreThanOneProperty.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -93,7 +94,7 @@
|
|||
{
|
||||
var expectedInstructions = source.CollectionWithOneItem;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.ClassWithInnerCollection);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\ClassWithInnerCollection.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -103,7 +104,7 @@
|
|||
{
|
||||
var expectedInstructions = source.CollectionWithMoreThanOneItem;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.CollectionWithMoreThanOneItem);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\CollectionWithMoreThanOneItem.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -113,7 +114,7 @@
|
|||
{
|
||||
var expectedInstructions = source.CollapsedTagWithProperty;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.CollapsedTagWithProperty);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\CollapsedTagWithProperty.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -124,7 +125,7 @@
|
|||
{
|
||||
var expectedInstructions = source.CollectionWithOneItemAndAMember;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.CollectionWithClosedItemAndProperty);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\CollectionWithClosedItemAndProperty.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -134,7 +135,7 @@
|
|||
{
|
||||
var expectedInstructions = source.SimpleExtension;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.SimpleExtension);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\SimpleExtension.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -144,7 +145,7 @@
|
|||
{
|
||||
var expectedInstructions = source.SimpleExtensionWithOneAssignment;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.SimpleExtensionWithOneAssignment);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\SimpleExtensionWithOneAssignment.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -154,7 +155,7 @@
|
|||
{
|
||||
var expectedInstructions = source.ContentPropertyForCollectionOneElement;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.ContentPropertyForCollectionOneElement);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\ContentPropertyForCollectionOneElement.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -164,7 +165,7 @@
|
|||
{
|
||||
var expectedInstructions = source.ContentPropertyForCollectionMoreThanOneElement;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.ContentPropertyForCollectionMoreThanOneElement);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\ContentPropertyForCollectionMoreThanOneElement.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -174,7 +175,7 @@
|
|||
{
|
||||
var expectedInstructions = source.ContentPropertyForSingleProperty;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.ContentPropertyForSingleMember);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\ContentPropertyForSingleMember.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
||||
|
@ -195,7 +196,7 @@
|
|||
{
|
||||
var expectedInstructions = source.KeyDirective2;
|
||||
|
||||
var actualNodes = ExtractNodesFromPullParser(Dummy.KeyDirective);
|
||||
var actualNodes = ExtractNodesFromPullParser(File.LoadAsString(@"Xaml\Dummy\KeyDirective.xaml"));
|
||||
|
||||
Assert.Equal(expectedInstructions.ToList(), actualNodes.ToList());
|
||||
}
|
|
@ -26,21 +26,21 @@
|
|||
public void SingleCollapsed()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.SingleCollapsed.ToList(), sut.Parse(ProtoInputs.SingleCollapsed).ToList());
|
||||
Assert.Equal(source.SingleCollapsed, sut.Parse(File.LoadAsString(@"Xaml\ProtoInputs\SingleCollapsed.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SingleOpenAndClose()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.SingleOpenAndClose.ToList(), sut.Parse(ProtoInputs.SingleOpenAndClose).ToList());
|
||||
Assert.Equal(source.SingleOpenAndClose, sut.Parse(File.LoadAsString(@"Xaml\ProtoInputs\SingleOpenAndClose.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ElementWithChild()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.ElementWithChild.ToList(), sut.Parse(ProtoInputs.ElementWithChild).ToList());
|
||||
Assert.Equal(source.ElementWithChild, sut.Parse(File.LoadAsString(@"Xaml\ProtoInputs\ElementWithChild.xaml")));
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,14 +48,14 @@
|
|||
public void ElementWith2NsDeclarations()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.ElementWith2NsDeclarations.ToList(), sut.Parse(ProtoInputs.ElementWith2NsDeclarations).ToList());
|
||||
Assert.Equal(source.ElementWith2NsDeclarations, sut.Parse(File.LoadAsString(@"Xaml\ProtoInputs\ElementWith2NsDeclarations.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SingleOpenWithNs()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.SingleOpenWithNs.ToList(), sut.Parse(ProtoInputs.SingleOpenAndCloseWithNs).ToList());
|
||||
Assert.Equal(source.SingleOpenWithNs, sut.Parse(File.LoadAsString(@"Xaml\ProtoInputs\SingleOpenAndCloseWithNs.xaml")));
|
||||
}
|
||||
|
||||
|
||||
|
@ -63,7 +63,8 @@
|
|||
public void TwoNestedProperties()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.TwoNestedProperties.ToList(), sut.Parse(Dummy.TwoNestedProperties).ToList());
|
||||
var load = File.LoadAsString(@"Xaml\Dummy\TwoNestedProperties.xaml");
|
||||
Assert.Equal(source.TwoNestedProperties, sut.Parse(load));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -71,29 +72,29 @@
|
|||
{
|
||||
var sut = CreateSut();
|
||||
|
||||
Assert.Throws<ParseException>(() => sut.Parse(ProtoInputs.PropertyTagOpen).ToList());
|
||||
Assert.Throws<ParseException>(() => sut.Parse(File.LoadAsString(@"Xaml\ProtoInputs\PropertyTagOpen.xaml")).ToList());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AttachedProperty()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.AttachedProperty.ToList(), sut.Parse(Dummy.WithAttachableProperty).ToList());
|
||||
Assert.Equal(source.AttachedProperty, sut.Parse(File.LoadAsString(@"Xaml\Dummy\WithAttachableProperty.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NestedAttachedProperty()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.ExpandedAttachedProperty.ToList(), sut.Parse(Dummy.ExpandedAttachableProperty).ToList());
|
||||
Assert.Equal(source.ExpandedAttachedProperty, sut.Parse(File.LoadAsString(@"Xaml\Dummy\ExpandedAttachableProperty.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExpandedAttachablePropertyAndItemBelow()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
var expected = source.ExpandedAttachablePropertyAndItemBelow.ToList();
|
||||
var actual = sut.Parse(Dummy.ExpandedAttachablePropertyAndItemBelow).ToList();
|
||||
var expected = source.ExpandedAttachablePropertyAndItemBelow;
|
||||
var actual = sut.Parse(File.LoadAsString(@"Xaml\Dummy\ExpandedAttachablePropertyAndItemBelow.xaml"));
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
|
@ -101,8 +102,8 @@
|
|||
public void PrefixedExpandedAttachablePropertyAndItemBelow()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
var expected = source.PrefixedExpandedAttachablePropertyAndItemBelow.ToList();
|
||||
var actual = sut.Parse(Dummy.PrefixedExpandedAttachablePropertyAndItemBelow).ToList();
|
||||
var expected = source.PrefixedExpandedAttachablePropertyAndItemBelow;
|
||||
var actual = sut.Parse(File.LoadAsString(@"Xaml\Dummy\PrefixedExpandedAttachablePropertyAndItemBelow.xaml"));
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
|
@ -110,30 +111,30 @@
|
|||
public void InstanceWithStringPropertyAndNsDeclaration()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.InstanceWithStringPropertyAndNsDeclaration.ToList(), sut.Parse(Dummy.StringProperty).ToList());
|
||||
Assert.Equal(source.InstanceWithStringPropertyAndNsDeclaration, sut.Parse(File.LoadAsString(@"Xaml\Dummy\StringProperty.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void KeyDirective()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.KeyDirective.ToList(), sut.Parse(Dummy.KeyDirective).ToList());
|
||||
Assert.Equal(source.KeyDirective, sut.Parse(File.LoadAsString(@"Xaml\Dummy\KeyDirective.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ContentPropertyForCollectionOneElement()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.ContentPropertyForCollectionOneElement.ToList(), sut.Parse(Dummy.ContentPropertyForCollectionOneElement).ToList());
|
||||
Assert.Equal(source.ContentPropertyForCollectionOneElement, sut.Parse(File.LoadAsString(@"Xaml\Dummy\ContentPropertyForCollectionOneElement.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ThreeLevelsOfNesting()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
var actualNodes = sut.Parse(Dummy.ThreeLevelsOfNesting).ToList();
|
||||
var actualNodes = sut.Parse(File.LoadAsString(@"Xaml\Dummy\ThreeLevelsOfNesting.xaml"));
|
||||
|
||||
Assert.Equal(source.ThreeLevelsOfNesting.ToList(), actualNodes);
|
||||
Assert.Equal(source.ThreeLevelsOfNesting, actualNodes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -142,71 +143,71 @@
|
|||
var sut = CreateSut();
|
||||
var sysNs = new NamespaceDeclaration("clr-namespace:System;assembly=mscorlib", "sys");
|
||||
|
||||
Assert.Equal(source.GetString(sysNs).ToList(), sut.Parse(Dummy.String).ToList());
|
||||
Assert.Equal(source.GetString(sysNs), sut.Parse(File.LoadAsString(@"Xaml\Dummy\String.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FourLevelsOfNesting()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.FourLevelsOfNesting.ToList(), sut.Parse(Dummy.FourLevelsOfNesting).ToList());
|
||||
Assert.Equal(source.FourLevelsOfNesting, sut.Parse(File.LoadAsString(@"Xaml\Dummy\FourLevelsOfNesting.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CollapsedTag()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.CollapsedTag.ToList(), sut.Parse(Dummy.CollapsedTag).ToList());
|
||||
Assert.Equal(source.CollapsedTag, sut.Parse(File.LoadAsString(@"Xaml\Dummy\CollapsedTag.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ChildCollection()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.CollectionWithMoreThanOneItem.ToList(), sut.Parse(Dummy.ChildCollection).ToList());
|
||||
Assert.Equal(source.CollectionWithMoreThanOneItem, sut.Parse(File.LoadAsString(@"Xaml\Dummy\ChildCollection.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExpandedStringProperty()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.ExpandedStringProperty.ToList(), sut.Parse(Dummy.InnerContent).ToList());
|
||||
Assert.Equal(source.ExpandedStringProperty, sut.Parse(File.LoadAsString(@"Xaml\Dummy\InnerContent.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TwoNestedPropertiesEmpty()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.TwoNestedPropertiesEmpty.ToList(), sut.Parse(Dummy.TwoNestedPropertiesEmpty).ToList());
|
||||
Assert.Equal(source.TwoNestedPropertiesEmpty, sut.Parse(File.LoadAsString(@"Xaml\Dummy\TwoNestedPropertiesEmpty.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CommentIsIgnored()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.SingleOpenAndClose.ToList(), sut.Parse(Dummy.Comment).ToList());
|
||||
Assert.Equal(source.SingleOpenAndClose, sut.Parse(File.LoadAsString(@"Xaml\Dummy\Comment.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TextInsideTextBlockIsAssignedAsTextProperty()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Equal(source.ContentPropertyInInnerContent.ToList(), sut.Parse(Dummy.ContentPropertyInInnerContent).ToList());
|
||||
Assert.Equal(source.ContentPropertyInInnerContent, sut.Parse(File.LoadAsString(@"Xaml\Dummy\ContentPropertyInInnerContent.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NonExistingProperty()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
Assert.Throws<ParseException>(() => sut.Parse(Dummy.NonExistingProperty).ToList());
|
||||
Assert.Throws<ParseException>(() => sut.Parse(File.LoadAsString(@"Xaml\Dummy\NonExistingProperty.xaml")).ToList());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PureCollection()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
var actual = sut.Parse(Dummy.PureCollection).ToList();
|
||||
var expected = source.PureCollection.ToList();
|
||||
var actual = sut.Parse(File.LoadAsString(@"Xaml\Dummy\PureCollection.xaml"));
|
||||
var expected = source.PureCollection;
|
||||
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
@ -215,8 +216,8 @@
|
|||
public void MixedCollection()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
var actual = sut.Parse(Dummy.MixedCollection).ToList();
|
||||
var expected = source.MixedCollection.ToList();
|
||||
var actual = sut.Parse(File.LoadAsString(@"Xaml\Dummy\MixedCollection.xaml"));
|
||||
var expected = source.MixedCollection;
|
||||
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
@ -225,8 +226,8 @@
|
|||
public void ChildInDeeperNameScopeWithNamesInTwoLevels()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
var expected = source.ChildInDeeperNameScopeWithNamesInTwoLevels.ToList();
|
||||
var actual = sut.Parse(Dummy.ChildInDeeperNameScopeWithNamesInTwoLevels).ToList();
|
||||
var expected = source.ChildInDeeperNameScopeWithNamesInTwoLevels;
|
||||
var actual = sut.Parse(File.LoadAsString(@"Xaml\Dummy\ChildInDeeperNameScopeWithNamesInTwoLevels.xaml"));
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
|
@ -234,8 +235,8 @@
|
|||
public void NamePropetyAndNameDirectiveProduceSameProtoInstructions()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
var expected = sut.Parse(Dummy.ChildInDeeperNameScopeWithNamesInTwoLevels).ToList();
|
||||
var actual = sut.Parse(Dummy.ChildInDeeperNameScopeWithNamesInTwoLevelsNoNameDirectives).ToList();
|
||||
var expected = sut.Parse(File.LoadAsString(@"Xaml\Dummy\ChildInDeeperNameScopeWithNamesInTwoLevels.xaml")).ToList();
|
||||
var actual = sut.Parse(File.LoadAsString(@"Xaml\Dummy\ChildInDeeperNameScopeWithNamesInTwoLevelsNoNameDirectives.xaml")).ToList();
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
|
@ -243,8 +244,8 @@
|
|||
public void AttachableMemberThatIsCollection()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
var expected = source.AttachableMemberThatIsCollection.ToList();
|
||||
var actual = sut.Parse(Dummy.AttachableMemberThatIsCollection).ToList();
|
||||
var expected = source.AttachableMemberThatIsCollection;
|
||||
var actual = sut.Parse(File.LoadAsString(@"Xaml\Dummy\AttachableMemberThatIsCollection.xaml"));
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
|
@ -252,8 +253,8 @@
|
|||
public void AttachableMemberThatIsCollectionImplicit()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
var expected = source.AttachableMemberThatIsCollectionImplicit.ToList();
|
||||
var actual = sut.Parse(Dummy.AttachableMemberThatIsCollectionImplicit).ToList();
|
||||
var expected = source.AttachableMemberThatIsCollectionImplicit;
|
||||
var actual = sut.Parse(File.LoadAsString(@"Xaml\Dummy\AttachableMemberThatIsCollectionImplicit.xaml"));
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
|
@ -261,8 +262,8 @@
|
|||
public void DirectContentForOneToMany()
|
||||
{
|
||||
var sut = CreateSut();
|
||||
var expected = source.DirectContentForOneToMany.ToList();
|
||||
var actual = sut.Parse(Dummy.DirectContentForOneToMany).ToList();
|
||||
var expected = source.DirectContentForOneToMany;
|
||||
var actual = sut.Parse(File.LoadAsString(@"Xaml\Dummy\DirectContentForOneToMany.xaml"));
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
namespace OmniXaml.Tests.XamlXmlLoaderTests
|
||||
{
|
||||
using Common;
|
||||
using Common.DotNetFx;
|
||||
|
||||
public class GivenAXmlLoader : GivenARuntimeTypeSourceNetCore
|
||||
public class GivenAXmlLoader : GivenARuntimeTypeSource
|
||||
{
|
||||
protected GivenAXmlLoader()
|
||||
{
|
|
@ -1,15 +1,15 @@
|
|||
namespace OmniXaml.Tests.XamlXmlLoaderTests
|
||||
{
|
||||
using Classes;
|
||||
using Xaml.Tests.Resources;
|
||||
using Xunit;
|
||||
using XamlResources = Xaml.Tests.Resources.Dummy;
|
||||
|
||||
public class MarkupExtensionsTests : GivenAXmlLoader
|
||||
{
|
||||
[Fact]
|
||||
public void SimpleExtension()
|
||||
{
|
||||
var actualInstance = Loader.FromString(XamlResources.SimpleExtension);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\SimpleExtension.xaml"));
|
||||
|
||||
Assert.IsType(typeof(DummyClass), actualInstance); // The retrieved instance should be of type DummyClass
|
||||
var dummyClass = actualInstance as DummyClass;
|
||||
|
@ -20,7 +20,7 @@
|
|||
[Fact]
|
||||
public void SimpleExtensionWithPropertyAssignment()
|
||||
{
|
||||
var actualInstance = Loader.FromString(XamlResources.SimpleExtensionWithOneAssignment);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\SimpleExtensionWithOneAssignment.xaml"));
|
||||
|
||||
Assert.IsType(typeof(DummyClass), actualInstance); // The retrieved instance should be of type DummyClass
|
||||
var dummyClass = actualInstance as DummyClass;
|
||||
|
@ -53,9 +53,7 @@
|
|||
[Fact]
|
||||
public void TwoQuotedValues()
|
||||
{
|
||||
|
||||
|
||||
var actualInstance = Loader.FromString(XamlResources.MarkupExtensionTwoQuotedValues);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\MarkupExtensionTwoQuotedValues.xaml"));
|
||||
|
||||
Assert.IsType(typeof(DummyClass), actualInstance); // The retrieved instance should be of type DummyClass
|
||||
var dummyClass = actualInstance as DummyClass;
|
|
@ -1,6 +1,7 @@
|
|||
namespace OmniXaml.Tests.XamlXmlLoaderTests
|
||||
{
|
||||
using Classes;
|
||||
using Parsers.Integration;
|
||||
using Xunit;
|
||||
using Xaml.Tests.Resources;
|
||||
|
||||
|
@ -12,7 +13,7 @@ namespace OmniXaml.Tests.XamlXmlLoaderTests
|
|||
RuntimeTypeSource.ClearNamescopes();
|
||||
RuntimeTypeSource.EnableNameScope<DummyClass>();
|
||||
|
||||
var actualInstance = Loader.FromString(Dummy.ChildInNameScope);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\ChildInNameScope.xaml"));
|
||||
var childInScope = ((DummyObject)actualInstance).Find("MyObject");
|
||||
Assert.IsType(typeof(ChildClass), childInScope);
|
||||
}
|
||||
|
@ -23,7 +24,7 @@ namespace OmniXaml.Tests.XamlXmlLoaderTests
|
|||
RuntimeTypeSource.ClearNamescopes();
|
||||
RuntimeTypeSource.EnableNameScope<DummyClass>();
|
||||
|
||||
var actualInstance = Loader.FromString(Dummy.ChildInNamescopeNoNameDirective);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\ChildInNamescopeNoNameDirective.xaml"));
|
||||
var childInScope = ((DummyObject)actualInstance).Find("MyObject");
|
||||
Assert.IsType(typeof(ChildClass), childInScope);
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
using System.Linq;
|
||||
using Classes;
|
||||
using Classes.WpfLikeModel;
|
||||
using Parsers.Integration;
|
||||
using Xunit;
|
||||
using Xaml.Tests.Resources;
|
||||
|
||||
|
@ -16,46 +17,46 @@
|
|||
[Fact]
|
||||
public void EmptyStreamThrows()
|
||||
{
|
||||
Assert.Throws<LoadException>(() => Loader.FromString(Dummy.Empty));
|
||||
Assert.Throws<LoadException>(() => Loader.FromString(File.LoadAsString(@"Xaml\Dummy\Empty.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UnknownElementThrows()
|
||||
{
|
||||
Assert.Throws<LoadException>(() => Loader.FromString(Dummy.UnknownType));
|
||||
Assert.Throws<LoadException>(() => Loader.FromString(File.LoadAsString(@"Xaml\Dummy\UnknownType.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BadFormatThrowsXamlReaderException()
|
||||
{
|
||||
Assert.Throws<LoadException>(() => Loader.FromString(Dummy.BadFormat));
|
||||
Assert.Throws<LoadException>(() => Loader.FromString(File.LoadAsString(@"Xaml\Dummy\BadFormat.xaml")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NoPrefixMapsToNamespaceAndReturnsTheCorrectInstance()
|
||||
{
|
||||
var actual = Loader.FromString(Dummy.RootNamespace);
|
||||
var actual = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\RootNamespace.xaml"));
|
||||
Assert.IsType(expectedType, actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SimpleXamlWithCollapsedTagsShouldReadLikeExplicitEndingTag()
|
||||
{
|
||||
var actual = Loader.FromString(Dummy.CollapsedTag);
|
||||
var actual = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\CollapsedTag.xaml"));
|
||||
Assert.IsType(expectedType, actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DifferentNamespacesShouldReturnCorrectInstances()
|
||||
{
|
||||
var actual = Loader.FromString(Dummy.DifferentNamespaces);
|
||||
var actual = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\DifferentNamespaces.xaml"));
|
||||
Assert.IsType(expectedType, actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReadInstanceWithChild()
|
||||
{
|
||||
var actualInstance = Loader.FromString(Dummy.InstanceWithChild);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\InstanceWithChild.xaml"));
|
||||
|
||||
Assert.IsType(typeof(DummyClass), actualInstance); // The retrieved instance should be of type DummyClass
|
||||
var dummyClass = actualInstance as DummyClass;
|
||||
|
@ -66,7 +67,7 @@
|
|||
[Fact]
|
||||
public void ReadInstanceWithThreeLevelsOfNesting()
|
||||
{
|
||||
var root = Loader.FromString(Dummy.ThreeLevelsOfNesting);
|
||||
var root = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\ThreeLevelsOfNesting.xaml"));
|
||||
|
||||
var dummy = root as DummyClass;
|
||||
Assert.IsType(typeof (DummyClass), root); // The retrieved instance should be of type DummyClass
|
||||
|
@ -82,7 +83,7 @@
|
|||
[Fact]
|
||||
public void KeyDirective()
|
||||
{
|
||||
var actual = Loader.FromString(Dummy.KeyDirective);
|
||||
var actual = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\KeyDirective.xaml"));
|
||||
Assert.IsType(typeof (DummyClass), actual);
|
||||
var dictionary = (IDictionary) ((DummyClass) actual).Resources;
|
||||
Assert.True(dictionary.Count > 0);
|
||||
|
@ -91,7 +92,7 @@
|
|||
[Fact]
|
||||
public void String()
|
||||
{
|
||||
var actual = Loader.FromString(Dummy.String);
|
||||
var actual = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\String.xaml"));
|
||||
Assert.IsType(typeof (string), actual);
|
||||
Assert.Equal("Text", actual);
|
||||
}
|
||||
|
@ -99,7 +100,7 @@
|
|||
[Fact]
|
||||
public void StringAsProperty()
|
||||
{
|
||||
var actual = Loader.FromString(Dummy.StringAsProperty);
|
||||
var actual = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\StringAsProperty.xaml"));
|
||||
Assert.IsType(typeof (DummyClass), actual);
|
||||
Assert.Equal("Text", ((DummyClass) actual).SampleProperty);
|
||||
}
|
||||
|
@ -107,7 +108,7 @@
|
|||
[Fact]
|
||||
public void StringWithWhitespace()
|
||||
{
|
||||
var actual = Loader.FromString(Dummy.StringWithWhitespace);
|
||||
var actual = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\StringWithWhitespace.xaml"));
|
||||
Assert.IsType(typeof (string), actual);
|
||||
Assert.Equal("Text", actual);
|
||||
}
|
||||
|
@ -115,7 +116,7 @@
|
|||
[Fact]
|
||||
public void Int()
|
||||
{
|
||||
var actual = Loader.FromString(Dummy.Int);
|
||||
var actual = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\Int.xaml"));
|
||||
Assert.IsType(typeof (int), actual);
|
||||
Assert.Equal(123, actual);
|
||||
}
|
||||
|
@ -123,7 +124,7 @@
|
|||
[Fact]
|
||||
public void StringProperty()
|
||||
{
|
||||
var actualInstance = Loader.FromString(Dummy.StringProperty);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\StringProperty.xaml"));
|
||||
|
||||
Assert.IsType(typeof (DummyClass), actualInstance); // The retrieved instance should be of type DummyClass
|
||||
var dummyClass = actualInstance as DummyClass;
|
||||
|
@ -134,7 +135,7 @@
|
|||
[Fact]
|
||||
public void ExpandedStringProperty()
|
||||
{
|
||||
var actualInstance = Loader.FromString(Dummy.InnerContent);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\InnerContent.xaml"));
|
||||
|
||||
Assert.IsType(typeof (DummyClass), actualInstance); // The retrieved instance should be of type DummyClass
|
||||
var dummyClass = actualInstance as DummyClass;
|
||||
|
@ -145,7 +146,7 @@
|
|||
[Fact]
|
||||
public void InnerContentIsContentProperty()
|
||||
{
|
||||
var actualInstance = Loader.FromString(Dummy.ContentPropertyInInnerContent);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\ContentPropertyInInnerContent.xaml"));
|
||||
|
||||
Assert.IsType(typeof (TextBlock), actualInstance); // $"The retrieved instance should be of type {typeof (TextBlock)}"
|
||||
var dummyClass = actualInstance as TextBlock;
|
||||
|
@ -156,7 +157,7 @@
|
|||
[Fact]
|
||||
public void NonStringProperty()
|
||||
{
|
||||
var actualInstance = Loader.FromString(Dummy.NonStringProperty);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\NonStringProperty.xaml"));
|
||||
|
||||
Assert.IsType(typeof (DummyClass), actualInstance); // The retrieved instance should be of type DummyClass
|
||||
var dummyClass = actualInstance as DummyClass;
|
||||
|
@ -167,7 +168,7 @@
|
|||
[Fact]
|
||||
public void ChildCollection()
|
||||
{
|
||||
var actualInstance = Loader.FromString(Dummy.ChildCollection);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\ChildCollection.xaml"));
|
||||
|
||||
Assert.IsType(typeof (DummyClass), actualInstance); // The retrieved instance should be of type DummyClass
|
||||
var dummyClass = actualInstance as DummyClass;
|
||||
|
@ -179,7 +180,7 @@
|
|||
[Fact]
|
||||
public void AttachedProperty()
|
||||
{
|
||||
var actualInstance = Loader.FromString(Dummy.AttachedProperty);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\AttachedProperty.xaml"));
|
||||
|
||||
Assert.IsType(typeof (DummyClass), actualInstance); // The retrieved instance should be of type DummyClass
|
||||
var dummyClass = actualInstance as DummyClass;
|
||||
|
@ -190,7 +191,7 @@
|
|||
[Fact]
|
||||
public void Ignorable()
|
||||
{
|
||||
var actualInstance = Loader.FromString(Dummy.Ignorable);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\Ignorable.xaml"));
|
||||
|
||||
Assert.IsType(typeof (DummyClass), actualInstance); // The retrieved instance should be of type DummyClass
|
||||
var dummyClass = actualInstance as DummyClass;
|
||||
|
@ -201,7 +202,7 @@
|
|||
[Fact]
|
||||
public void DirectiveInSpecialNamespaceThatIsNotX()
|
||||
{
|
||||
var actual = Loader.FromString(Dummy.KeyDirectiveNotInX);
|
||||
var actual = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\KeyDirectiveNotInX.xaml"));
|
||||
Assert.IsType(typeof(DummyClass), actual);
|
||||
var dictionary = (IDictionary)((DummyClass)actual).Resources;
|
||||
Assert.True(dictionary.Count > 0);
|
||||
|
@ -210,8 +211,9 @@
|
|||
[Fact]
|
||||
public void ExpandedAttachablePropertyAndItemBelow()
|
||||
{
|
||||
var loadedObject = Loader.FromString(Dummy.ExpandedAttachablePropertyAndItemBelow);
|
||||
|
||||
var loadedObject = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\ExpandedAttachablePropertyAndItemBelow.xaml"));
|
||||
|
||||
|
||||
var items = ((DummyClass)loadedObject).Items;
|
||||
|
||||
var firstChild = items.First();
|
||||
|
@ -223,14 +225,14 @@
|
|||
[Fact]
|
||||
public void PureCollection()
|
||||
{
|
||||
var actualInstance = Loader.FromString(Dummy.PureCollection);
|
||||
var actualInstance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\PureCollection.xaml"));
|
||||
Assert.NotEmpty((IEnumerable) actualInstance);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AttachableMemberThatIsCollection()
|
||||
{
|
||||
var instance = Loader.FromString(Dummy.AttachableMemberThatIsCollection);
|
||||
var instance = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\AttachableMemberThatIsCollection.xaml"));
|
||||
var col = Container.GetCollection(instance);
|
||||
|
||||
Assert.NotEmpty(col);
|
||||
|
@ -239,7 +241,7 @@
|
|||
[Fact]
|
||||
public void ChildInDeeperNameScopeWithNamesInTwoLevels_HaveCorrectNames()
|
||||
{
|
||||
var actual = Loader.FromString(Dummy.ChildInDeeperNameScopeWithNamesInTwoLevels);
|
||||
var actual = Loader.FromString(File.LoadAsString(@"Xaml\Dummy\ChildInDeeperNameScopeWithNamesInTwoLevels.xaml"));
|
||||
|
||||
var w = (Window)actual;
|
||||
var lb = (ListBox)w.Content;
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче