aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-10-04 13:43:26 -0500
committerrogerk <devnull@localhost>2011-10-04 13:43:26 -0500
commiteac64a5f7afdfca32476534fd8d0bf69d77002ca (patch)
tree03a38e9992afd1ffb929f3f830d6054009a9cba2 /src
parent5e48fef659b571db38be18afb61bea0cffcdfdca (diff)
downloadprotobuf-eac64a5f7afdfca32476534fd8d0bf69d77002ca.tar.gz
protobuf-eac64a5f7afdfca32476534fd8d0bf69d77002ca.tar.bz2
protobuf-eac64a5f7afdfca32476534fd8d0bf69d77002ca.zip
- Upgraded NUnit
- Added StatLight and Silverlight unit testing - Added copies of all projects for Silverlight - Integrated Silverlight unit tests in build
Diffstat (limited to 'src')
-rw-r--r--src/ProtoDump/ProtoDump.csproj180
-rw-r--r--src/ProtoGen.Test/ProtoGen.Test.csproj252
-rw-r--r--src/ProtoGen/ServiceInterfaceGenerator.cs17
-rw-r--r--src/ProtoMunge/ProtoMunge.csproj180
-rw-r--r--src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization(Silverlight).csproj99
-rw-r--r--src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj75
-rw-r--r--src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization(Silverlight).csproj99
-rw-r--r--src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj75
-rw-r--r--src/ProtocolBuffers.Test/AbstractMessageTest.cs38
-rw-r--r--src/ProtocolBuffers.Test/App.xaml8
-rw-r--r--src/ProtocolBuffers.Test/App.xaml.cs60
-rw-r--r--src/ProtocolBuffers.Test/ByteStringTest.cs30
-rw-r--r--src/ProtocolBuffers.Test/CSharpOptionsTest.cs20
-rw-r--r--src/ProtocolBuffers.Test/CodedInputStreamTest.cs34
-rw-r--r--src/ProtocolBuffers.Test/CodedOutputStreamTest.cs78
-rw-r--r--src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs48
-rw-r--r--src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs14
-rw-r--r--src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs33
-rw-r--r--src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs11
-rw-r--r--src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs6
-rw-r--r--src/ProtocolBuffers.Test/Compatibility/TestResources.cs9
-rw-r--r--src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs12
-rw-r--r--src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs13
-rw-r--r--src/ProtocolBuffers.Test/DeprecatedMemberTest.cs16
-rw-r--r--src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs12
-rw-r--r--src/ProtocolBuffers.Test/DescriptorsTest.cs38
-rw-r--r--src/ProtocolBuffers.Test/DynamicMessageTest.cs36
-rw-r--r--src/ProtocolBuffers.Test/ExtendableMessageTest.cs10
-rw-r--r--src/ProtocolBuffers.Test/GeneratedBuilderTest.cs24
-rw-r--r--src/ProtocolBuffers.Test/GeneratedMessageTest.cs86
-rw-r--r--src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs8
-rw-r--r--src/ProtocolBuffers.Test/MessageStreamWriterTest.cs6
-rw-r--r--src/ProtocolBuffers.Test/MessageTest.cs40
-rw-r--r--src/ProtocolBuffers.Test/MessageUtilTest.cs16
-rw-r--r--src/ProtocolBuffers.Test/NameHelpersTest.cs10
-rw-r--r--src/ProtocolBuffers.Test/Properties/AppManifest.xml6
-rw-r--r--src/ProtocolBuffers.Test/ProtocolBuffers.Test(Silverlight).csproj184
-rw-r--r--src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj16
-rw-r--r--src/ProtocolBuffers.Test/ReflectionTester.cs24
-rw-r--r--src/ProtocolBuffers.Test/ReusableBuilderTest.cs34
-rw-r--r--src/ProtocolBuffers.Test/SerializableAttribute.cs12
-rw-r--r--src/ProtocolBuffers.Test/SerializableTest.cs12
-rw-r--r--src/ProtocolBuffers.Test/ServiceTest.cs17
-rw-r--r--src/ProtocolBuffers.Test/TestCornerCases.cs6
-rw-r--r--src/ProtocolBuffers.Test/TestMimeMessageFormats.cs58
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs10
-rw-r--r--src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs14
-rw-r--r--src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs18
-rw-r--r--src/ProtocolBuffers.Test/TestRpcGenerator.cs6
-rw-r--r--src/ProtocolBuffers.Test/TestUtil.cs224
-rw-r--r--src/ProtocolBuffers.Test/TestWriterFormatJson.cs64
-rw-r--r--src/ProtocolBuffers.Test/TestWriterFormatXml.cs54
-rw-r--r--src/ProtocolBuffers.Test/TextFormatTest.cs60
-rw-r--r--src/ProtocolBuffers.Test/UnknownFieldSetTest.cs44
-rw-r--r--src/ProtocolBuffers.Test/WireFormatTest.cs28
-rw-r--r--src/ProtocolBuffers.sln103
-rw-r--r--src/ProtocolBuffers/ProtocolBuffers(Silverlight).csproj162
-rw-r--r--src/ProtocolBuffers/ProtocolBuffers.csproj85
-rw-r--r--src/ProtocolBuffers/ProtocolBuffersLite(Silverlight).csproj106
-rw-r--r--src/ProtocolBuffers/ProtocolBuffersLite.csproj42
-rw-r--r--src/ProtocolBuffers/ThrowHelper.cs9
-rw-r--r--src/ProtocolBuffers2008.sln103
-rw-r--r--src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs66
-rw-r--r--src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs24
-rw-r--r--src/ProtocolBuffersLite.Test/App.xaml8
-rw-r--r--src/ProtocolBuffersLite.Test/App.xaml.cs60
-rw-r--r--src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs46
-rw-r--r--src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs47
-rw-r--r--src/ProtocolBuffersLite.Test/InteropLiteTest.cs28
-rw-r--r--src/ProtocolBuffersLite.Test/LiteTest.cs8
-rw-r--r--src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs28
-rw-r--r--src/ProtocolBuffersLite.Test/Properties/AppManifest.xml6
-rw-r--r--src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test(Silverlight).csproj147
-rw-r--r--src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj14
-rw-r--r--src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test(Silverlight).csproj142
-rw-r--r--src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj14
-rw-r--r--src/ProtocolBuffersLite.Test/SerializableAttribute.cs12
-rw-r--r--src/ProtocolBuffersLite.Test/SerializableLiteTest.cs8
-rw-r--r--src/ProtocolBuffersLite.Test/TestLiteByApi.cs20
-rw-r--r--src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs10
-rw-r--r--src/ProtocolBuffersLite.Test/TestUtil.cs31
81 files changed, 2530 insertions, 1383 deletions
diff --git a/src/ProtoDump/ProtoDump.csproj b/src/ProtoDump/ProtoDump.csproj
index 9e145736..f07cdc0f 100644
--- a/src/ProtoDump/ProtoDump.csproj
+++ b/src/ProtoDump/ProtoDump.csproj
@@ -1,97 +1,97 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{D7282E99-2DC3-405B-946F-177DB2FD2AE2}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Google.ProtocolBuffers.ProtoDump</RootNamespace>
- <AssemblyName>ProtoDump</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <OldToolsVersion>3.5</OldToolsVersion>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="mscorlib" />
- <Reference Include="System" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
- <Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
- <Name>ProtocolBuffers</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{D7282E99-2DC3-405B-946F-177DB2FD2AE2}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers.ProtoDump</RootNamespace>
+ <AssemblyName>ProtoDump</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
+ <Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
+ <Name>ProtocolBuffers</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
- -->
+ -->
</Project> \ No newline at end of file
diff --git a/src/ProtoGen.Test/ProtoGen.Test.csproj b/src/ProtoGen.Test/ProtoGen.Test.csproj
index d08cbb73..5325be51 100644
--- a/src/ProtoGen.Test/ProtoGen.Test.csproj
+++ b/src/ProtoGen.Test/ProtoGen.Test.csproj
@@ -1,124 +1,130 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{C268DA4C-4004-47DA-AF23-44C983281A68}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Google.ProtocolBuffers.ProtoGen</RootNamespace>
- <AssemblyName>Google.ProtocolBuffers.ProtoGen.Test</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <SignAssembly>true</SignAssembly>
- <AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <OldToolsVersion>3.5</OldToolsVersion>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\NUnit 2.2.8.0\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="Rhino.Mocks, Version=3.5.0.2, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\Rhino.Mocks.dll</HintPath>
- </Reference>
- <Reference Include="mscorlib" />
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="DependencyResolutionTest.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="TempFile.cs" />
- <Compile Include="TestPreprocessing.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
- <Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
- <Name>ProtocolBuffers</Name>
- </ProjectReference>
- <ProjectReference Include="..\ProtoGen\ProtoGen.csproj">
- <Project>{250ADE34-82FD-4BAE-86D5-985FBE589C4A}</Project>
- <Name>ProtoGen</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <None Include="..\..\lib\protoc.exe">
- <Link>protoc.exe</Link>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </None>
- <None Include="..\..\protos\google\protobuf\csharp_options.proto">
- <Link>google\protobuf\csharp_options.proto</Link>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </None>
- <None Include="..\..\protos\google\protobuf\descriptor.proto">
- <Link>google\protobuf\descriptor.proto</Link>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </None>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C268DA4C-4004-47DA-AF23-44C983281A68}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers.ProtoGen</RootNamespace>
+ <AssemblyName>Google.ProtocolBuffers.ProtoGen.Test</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="Rhino.Mocks, Version=3.5.0.2, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\Rhino.Mocks.dll</HintPath>
+ </Reference>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="DependencyResolutionTest.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="TempFile.cs" />
+ <Compile Include="TestPreprocessing.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
+ <Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
+ <Name>ProtocolBuffers</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\ProtoGen\ProtoGen.csproj">
+ <Project>{250ADE34-82FD-4BAE-86D5-985FBE589C4A}</Project>
+ <Name>ProtoGen</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <None Include="..\..\lib\protoc.exe">
+ <Link>protoc.exe</Link>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="..\..\protos\google\protobuf\csharp_options.proto">
+ <Link>google\protobuf\csharp_options.proto</Link>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="..\..\protos\google\protobuf\descriptor.proto">
+ <Link>google\protobuf\descriptor.proto</Link>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <PropertyGroup>
+ <StartAction>Program</StartAction>
+ <StartProgram>$(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe</StartProgram>
+ <StartArguments>/nologo /noshadow /labels /wait $(AssemblyName).dll</StartArguments>
+ <StartWorkingDirectory>$(ProjectDir)$(OutputPath)</StartWorkingDirectory>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/src/ProtoGen/ServiceInterfaceGenerator.cs b/src/ProtoGen/ServiceInterfaceGenerator.cs
index 041cffce..64b6d69b 100644
--- a/src/ProtoGen/ServiceInterfaceGenerator.cs
+++ b/src/ProtoGen/ServiceInterfaceGenerator.cs
@@ -159,8 +159,7 @@ namespace Google.ProtocolBuffers.ProtoGen
writer.WriteLine("public {0}(pb::IRpcDispatch dispatch) : this(dispatch, true) {{", Descriptor.Name);
writer.WriteLine("}");
writer.WriteLine("public {0}(pb::IRpcDispatch dispatch, bool dispose) {{", Descriptor.Name);
- writer.WriteLine(
- " if (null == (this.dispatch = dispatch)) throw new global::System.ArgumentNullException();");
+ writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.dispatch = dispatch, \"dispatch\");");
writer.WriteLine(" this.dispose = dispose && dispatch is global::System.IDisposable;");
writer.WriteLine("}");
writer.WriteLine();
@@ -209,8 +208,7 @@ namespace Google.ProtocolBuffers.ProtoGen
Descriptor.Name);
writer.WriteLine("}");
writer.WriteLine("public Dispatch(I{0} implementation, bool dispose) {{", Descriptor.Name);
- writer.WriteLine(
- " if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException();");
+ writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, \"implementation\");");
writer.WriteLine(" this.dispose = dispose && implementation is global::System.IDisposable;");
writer.WriteLine("}");
writer.WriteLine();
@@ -235,9 +233,7 @@ namespace Google.ProtocolBuffers.ProtoGen
method.Name, NameHelpers.UnderscoresToPascalCase(method.Name),
GetClassName(method.InputType));
}
- writer.WriteLine(
- "default: throw new global::System.MissingMethodException(typeof(I{0}).FullName, methodName);",
- Descriptor.Name);
+ writer.WriteLine("default: throw pb::ThrowHelper.CreateMissingMethod(typeof(I{0}), methodName);", Descriptor.Name);
writer.Outdent();
writer.WriteLine("}"); //end switch
writer.Outdent();
@@ -272,8 +268,7 @@ namespace Google.ProtocolBuffers.ProtoGen
writer.WriteLine("public ServerStub(pb::IRpcDispatch implementation) : this(implementation, true) {");
writer.WriteLine("}");
writer.WriteLine("public ServerStub(pb::IRpcDispatch implementation, bool dispose) {");
- writer.WriteLine(
- " if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException();");
+ writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, \"implementation\");");
writer.WriteLine(" this.dispose = dispose && implementation is global::System.IDisposable;");
writer.WriteLine("}");
writer.WriteLine();
@@ -296,9 +291,7 @@ namespace Google.ProtocolBuffers.ProtoGen
"case \"{0}\": return implementation.CallMethod(methodName, {1}.ParseFrom(input, registry), {2}.CreateBuilder());",
method.Name, GetClassName(method.InputType), GetClassName(method.OutputType));
}
- writer.WriteLine(
- "default: throw new global::System.MissingMethodException(typeof(I{0}).FullName, methodName);",
- Descriptor.Name);
+ writer.WriteLine("default: throw pb::ThrowHelper.CreateMissingMethod(typeof(I{0}), methodName);", Descriptor.Name);
writer.Outdent();
writer.WriteLine("}"); //end switch
writer.Outdent();
diff --git a/src/ProtoMunge/ProtoMunge.csproj b/src/ProtoMunge/ProtoMunge.csproj
index a04276cc..a62fdcc2 100644
--- a/src/ProtoMunge/ProtoMunge.csproj
+++ b/src/ProtoMunge/ProtoMunge.csproj
@@ -1,97 +1,97 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{8F09AF72-3327-4FA7-BC09-070B80221AB9}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Google.ProtocolBuffers.ProtoMunge</RootNamespace>
- <AssemblyName>ProtoMunge</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <OldToolsVersion>3.5</OldToolsVersion>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="mscorlib" />
- <Reference Include="System" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
- <Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
- <Name>ProtocolBuffers</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{8F09AF72-3327-4FA7-BC09-070B80221AB9}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers.ProtoMunge</RootNamespace>
+ <AssemblyName>ProtoMunge</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
+ <Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
+ <Name>ProtocolBuffers</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
- -->
+ -->
</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization(Silverlight).csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization(Silverlight).csproj
new file mode 100644
index 00000000..5c05adb8
--- /dev/null
+++ b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization(Silverlight).csproj
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{72B69A15-E28E-4738-A779-18D76C87D225}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers.Serialization</RootNamespace>
+ <AssemblyName>Google.ProtocolBuffers.Serialization</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <SilverlightApplication>false</SilverlightApplication>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <ValidateXaml>true</ValidateXaml>
+ <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug_Silverlight\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release_Silverlight\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v2.0' ">
+ <DefineConstants>NET20;$(DefineConstants)</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Core" Condition="'$(TargetFrameworkVersion)' != 'v2.0'" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Extensions.cs" />
+ <Compile Include="Http\FormUrlEncodedReader.cs" />
+ <Compile Include="Http\MessageFormatFactory.cs" />
+ <Compile Include="Http\MessageFormatOptions.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="AbstractReader.cs" />
+ <Compile Include="AbstractTextReader.cs" />
+ <Compile Include="AbstractTextWriter.cs" />
+ <Compile Include="AbstractWriter.cs" />
+ <Compile Include="DictionaryReader.cs" />
+ <Compile Include="DictionaryWriter.cs" />
+ <Compile Include="JsonFormatReader.cs" />
+ <Compile Include="JsonFormatWriter.cs" />
+ <Compile Include="JsonTextCursor.cs" />
+ <Compile Include="RecursionLimitExceeded.cs" />
+ <Compile Include="XmlFormatReader.cs" />
+ <Compile Include="XmlFormatWriter.cs" />
+ <Compile Include="XmlReaderOptions.cs" />
+ <Compile Include="XmlWriterOptions.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers%28Silverlight%29.csproj">
+ <Project>{7E4E681E-5D09-43FB-8D9E-35A454730A85}</Project>
+ <Name>ProtocolBuffers%28Silverlight%29</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj
index 1b246f1f..6ac39241 100644
--- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj
+++ b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj
@@ -14,28 +14,7 @@
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
- <DefineConstants Condition=" '$(TargetFrameworkVersion)' == 'v2.0' ">NET20;</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -44,11 +23,10 @@
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>$(DefineConstants)TRACE;DEBUG;</DefineConstants>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -56,36 +34,13 @@
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>$(DefineConstants)TRACE;</DefineConstants>
+ <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU'">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug_Silverlight\</OutputPath>
- <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
- <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>$(DefineConstants)TRACE;DEBUG;SILVERLIGHT</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU'">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release_Silverlight\</OutputPath>
- <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
- <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>$(DefineConstants)TRACE;SILVERLIGHT</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v2.0' ">
+ <DefineConstants>NET20;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
@@ -115,33 +70,13 @@
<Compile Include="XmlWriterOptions.cs" />
</ItemGroup>
<ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
<ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
<Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
<Name>ProtocolBuffers</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Debug' " />
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Release' " />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(Configuration)' == 'Debug_Silverlight' " />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(Configuration)' == 'Release_Silverlight' " />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization(Silverlight).csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization(Silverlight).csproj
new file mode 100644
index 00000000..9bbb94fb
--- /dev/null
+++ b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization(Silverlight).csproj
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{B6CDC03B-EBBD-4F38-9F84-736EC0948090}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers.Serialization</RootNamespace>
+ <AssemblyName>Google.ProtocolBuffersLite.Serialization</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <SilverlightApplication>false</SilverlightApplication>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <ValidateXaml>true</ValidateXaml>
+ <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug_Silverlight\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;LITE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release_Silverlight\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>TRACE;SILVERLIGHT;LITE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v2.0' ">
+ <DefineConstants>NET20;$(DefineConstants)</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Core" Condition="'$(TargetFrameworkVersion)' != 'v2.0'" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Extensions.cs" />
+ <Compile Include="Http\FormUrlEncodedReader.cs" />
+ <Compile Include="Http\MessageFormatFactory.cs" />
+ <Compile Include="Http\MessageFormatOptions.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="AbstractReader.cs" />
+ <Compile Include="AbstractTextReader.cs" />
+ <Compile Include="AbstractTextWriter.cs" />
+ <Compile Include="AbstractWriter.cs" />
+ <Compile Include="DictionaryReader.cs" />
+ <Compile Include="DictionaryWriter.cs" />
+ <Compile Include="JsonFormatReader.cs" />
+ <Compile Include="JsonFormatWriter.cs" />
+ <Compile Include="JsonTextCursor.cs" />
+ <Compile Include="RecursionLimitExceeded.cs" />
+ <Compile Include="XmlFormatReader.cs" />
+ <Compile Include="XmlFormatWriter.cs" />
+ <Compile Include="XmlReaderOptions.cs" />
+ <Compile Include="XmlWriterOptions.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffersLite%28Silverlight%29.csproj">
+ <Project>{2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}</Project>
+ <Name>ProtocolBuffersLite%28Silverlight%29</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj
index d9794fa0..0c4222d9 100644
--- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj
+++ b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj
@@ -14,28 +14,7 @@
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
- <DefineConstants Condition=" '$(TargetFrameworkVersion)' == 'v2.0' ">NET20;</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -44,11 +23,10 @@
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>$(DefineConstants)TRACE;DEBUG</DefineConstants>
+ <DefineConstants>DEBUG;TRACE;LITE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -56,36 +34,13 @@
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>$(DefineConstants)TRACE;</DefineConstants>
+ <DefineConstants>TRACE;LITE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU'">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug_Silverlight\</OutputPath>
- <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
- <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>$(DefineConstants)TRACE;DEBUG;SILVERLIGHT</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU'">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release_Silverlight\</OutputPath>
- <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
- <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>$(DefineConstants)TRACE;SILVERLIGHT</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v2.0' ">
+ <DefineConstants>NET20;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
@@ -115,33 +70,13 @@
<Compile Include="XmlWriterOptions.cs" />
</ItemGroup>
<ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
<ProjectReference Include="..\ProtocolBuffers\ProtocolBuffersLite.csproj">
<Project>{6969BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
<Name>ProtocolBuffersLite</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Debug' " />
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Release' " />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(Configuration)' == 'Debug_Silverlight' " />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(Configuration)' == 'Release_Silverlight' " />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/src/ProtocolBuffers.Test/AbstractMessageTest.cs b/src/ProtocolBuffers.Test/AbstractMessageTest.cs
index a502a6cd..02793aeb 100644
--- a/src/ProtocolBuffers.Test/AbstractMessageTest.cs
+++ b/src/ProtocolBuffers.Test/AbstractMessageTest.cs
@@ -38,15 +38,15 @@ using System;
using System.Collections.Generic;
using System.IO;
using Google.ProtocolBuffers.Descriptors;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using Google.ProtocolBuffers.TestProtos;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class AbstractMessageTest
{
- [Test]
+ [TestMethod]
public void Clear()
{
AbstractMessageWrapper message =
@@ -54,7 +54,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertClear((TestAllTypes) message.WrappedMessage);
}
- [Test]
+ [TestMethod]
public void Copy()
{
AbstractMessageWrapper message =
@@ -62,14 +62,14 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllFieldsSet((TestAllTypes) message.WrappedMessage);
}
- [Test]
+ [TestMethod]
public void CreateAndBuild()
{
TestAllTypes.CreateBuilder()
.Build();
}
- [Test]
+ [TestMethod]
public void SerializedSize()
{
TestAllTypes message = TestUtil.GetAllSet();
@@ -78,7 +78,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(message.SerializedSize, abstractMessage.SerializedSize);
}
- [Test]
+ [TestMethod]
public void Serialization()
{
IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetAllSet());
@@ -86,7 +86,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(TestUtil.GetAllSet().ToByteString(), abstractMessage.ToByteString());
}
- [Test]
+ [TestMethod]
public void Parsing()
{
IBuilder builder = new AbstractMessageWrapper.Builder(TestAllTypes.CreateBuilder());
@@ -95,7 +95,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllFieldsSet((TestAllTypes) message.WrappedMessage);
}
- [Test]
+ [TestMethod]
public void PackedSerialization()
{
IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetPackedSet());
@@ -103,7 +103,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(TestUtil.GetPackedSet().ToByteString(), abstractMessage.ToByteString());
}
- [Test]
+ [TestMethod]
public void PackedParsing()
{
AbstractMessageWrapper.Builder builder = new AbstractMessageWrapper.Builder(TestPackedTypes.CreateBuilder());
@@ -111,7 +111,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertPackedFieldsSet((TestPackedTypes)message.WrappedMessage);
}
- [Test]
+ [TestMethod]
public void UnpackedParsingOfPackedInput()
{
byte[] bytes = TestUtil.GetPackedSet().ToByteArray();
@@ -119,7 +119,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertUnpackedFieldsSet(message);
}
- [Test]
+ [TestMethod]
public void PackedParsingOfUnpackedInput()
{
byte[] bytes = TestUnpackedTypes.ParseFrom(TestUtil.GetPackedSet().ToByteArray()).ToByteArray();
@@ -127,7 +127,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertPackedFieldsSet(message);
}
- [Test]
+ [TestMethod]
public void UnpackedParsingOfPackedInputExtensions()
{
byte[] bytes = TestUtil.GetPackedSet().ToByteArray();
@@ -138,7 +138,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertUnpackedExtensionsSet(message);
}
- [Test]
+ [TestMethod]
public void PackedParsingOfUnpackedInputExtensions()
{
byte[] bytes = TestUnpackedTypes.ParseFrom(TestUtil.GetPackedSet().ToByteArray()).ToByteArray();
@@ -148,7 +148,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertPackedExtensionsSet(message);
}
- [Test]
+ [TestMethod]
public void OptimizedForSize()
{
// We're mostly only Checking that this class was compiled successfully.
@@ -165,7 +165,7 @@ namespace Google.ProtocolBuffers
private static readonly TestRequired TestRequiredInitialized =
TestRequired.CreateBuilder().SetA(1).SetB(2).SetC(3).Build();
- [Test]
+ [TestMethod]
public void IsInitialized()
{
TestRequired.Builder builder = TestRequired.CreateBuilder();
@@ -180,7 +180,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(abstractBuilder.IsInitialized);
}
- [Test]
+ [TestMethod]
public void ForeignIsInitialized()
{
TestRequiredForeign.Builder builder = TestRequiredForeign.CreateBuilder();
@@ -227,7 +227,7 @@ namespace Google.ProtocolBuffers
"repeated_string: \"qux\"\n" +
"repeated_string: \"bar\"\n";
- [Test]
+ [TestMethod]
public void MergeFrom()
{
AbstractMessageWrapper result = (AbstractMessageWrapper)
@@ -241,7 +241,7 @@ namespace Google.ProtocolBuffers
// -----------------------------------------------------------------
// Tests for equals and hashCode
- [Test]
+ [TestMethod]
public void EqualsAndHashCode()
{
TestAllTypes a = TestUtil.GetAllSet();
diff --git a/src/ProtocolBuffers.Test/App.xaml b/src/ProtocolBuffers.Test/App.xaml
new file mode 100644
index 00000000..d4f1f2e3
--- /dev/null
+++ b/src/ProtocolBuffers.Test/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="ProtocolBuffers.SilverlightTest.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/src/ProtocolBuffers.Test/App.xaml.cs b/src/ProtocolBuffers.Test/App.xaml.cs
new file mode 100644
index 00000000..0c9fd9e6
--- /dev/null
+++ b/src/ProtocolBuffers.Test/App.xaml.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Windows;
+using Microsoft.Silverlight.Testing;
+
+namespace Google.ProtocolBuffers
+{
+ public partial class App : Application
+ {
+
+ public App()
+ {
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+
+ //InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ this.RootVisual = UnitTestSystem.CreateTestPage();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(
+ new EventHandler<ApplicationUnhandledExceptionEventArgs>(ReportErrorToDOM),
+ new object[] { sender, e } );
+ }
+ }
+ private void ReportErrorToDOM(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/ProtocolBuffers.Test/ByteStringTest.cs b/src/ProtocolBuffers.Test/ByteStringTest.cs
index 0ba665de..97425fe8 100644
--- a/src/ProtocolBuffers.Test/ByteStringTest.cs
+++ b/src/ProtocolBuffers.Test/ByteStringTest.cs
@@ -35,20 +35,20 @@
#endregion
using System.Text;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class ByteStringTest
{
- [Test]
+ [TestMethod]
public void EmptyByteStringHasZeroSize()
{
Assert.AreEqual(0, ByteString.Empty.Length);
}
- [Test]
+ [TestMethod]
public void CopyFromStringWithExplicitEncoding()
{
ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode);
@@ -59,19 +59,19 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(0, bs[3]);
}
- [Test]
+ [TestMethod]
public void IsEmptyWhenEmpty()
{
Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty);
}
- [Test]
+ [TestMethod]
public void IsEmptyWhenNotEmpty()
{
Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty);
}
- [Test]
+ [TestMethod]
public void CopyFromByteArrayCopiesContents()
{
byte[] data = new byte[1];
@@ -82,19 +82,19 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(10, bs[0]);
}
- [Test]
+ [TestMethod]
public void ToByteArrayCopiesContents()
{
ByteString bs = ByteString.CopyFromUtf8("Hello");
byte[] data = bs.ToByteArray();
- Assert.AreEqual('H', data[0]);
- Assert.AreEqual('H', bs[0]);
+ Assert.AreEqual((byte)'H', data[0]);
+ Assert.AreEqual((byte)'H', bs[0]);
data[0] = 0;
Assert.AreEqual(0, data[0]);
- Assert.AreEqual('H', bs[0]);
+ Assert.AreEqual((byte)'H', bs[0]);
}
- [Test]
+ [TestMethod]
public void CopyFromUtf8UsesUtf8()
{
ByteString bs = ByteString.CopyFromUtf8("\u20ac");
@@ -104,7 +104,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(0xac, bs[2]);
}
- [Test]
+ [TestMethod]
public void CopyFromPortion()
{
byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6};
@@ -114,14 +114,14 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(3, bs[1]);
}
- [Test]
+ [TestMethod]
public void ToStringUtf8()
{
ByteString bs = ByteString.CopyFromUtf8("\u20ac");
Assert.AreEqual("\u20ac", bs.ToStringUtf8());
}
- [Test]
+ [TestMethod]
public void ToStringWithExplicitEncoding()
{
ByteString bs = ByteString.CopyFrom("\u20ac", Encoding.Unicode);
diff --git a/src/ProtocolBuffers.Test/CSharpOptionsTest.cs b/src/ProtocolBuffers.Test/CSharpOptionsTest.cs
index 3901933b..752d9a0c 100644
--- a/src/ProtocolBuffers.Test/CSharpOptionsTest.cs
+++ b/src/ProtocolBuffers.Test/CSharpOptionsTest.cs
@@ -36,14 +36,14 @@
using Google.ProtocolBuffers.DescriptorProtos;
using Google.ProtocolBuffers.Descriptors;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class DescriptorUtilTest
{
- [Test]
+ [TestMethod]
public void ExplicitNamespace()
{
FileDescriptorProto proto = new FileDescriptorProto.Builder
@@ -60,7 +60,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("Foo.Bar", descriptor.CSharpOptions.Namespace);
}
- [Test]
+ [TestMethod]
public void NoNamespaceFallsBackToPackage()
{
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x", Package = "pack"}.Build();
@@ -68,7 +68,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("pack", descriptor.CSharpOptions.Namespace);
}
- [Test]
+ [TestMethod]
public void NoNamespaceOrPackageFallsBackToEmptyString()
{
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x"}.Build();
@@ -76,7 +76,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("", descriptor.CSharpOptions.Namespace);
}
- [Test]
+ [TestMethod]
public void ExplicitlyNamedFileClass()
{
FileDescriptorProto proto = new FileDescriptorProto.Builder
@@ -92,7 +92,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("Foo", descriptor.CSharpOptions.UmbrellaClassname);
}
- [Test]
+ [TestMethod]
public void ImplicitFileClassWithProtoSuffix()
{
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar.proto"}.Build();
@@ -100,7 +100,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname);
}
- [Test]
+ [TestMethod]
public void ImplicitFileClassWithProtoDevelSuffix()
{
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar.protodevel"}.Build();
@@ -108,7 +108,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname);
}
- [Test]
+ [TestMethod]
public void ImplicitFileClassWithNoSuffix()
{
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar"}.Build();
@@ -116,7 +116,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname);
}
- [Test]
+ [TestMethod]
public void ImplicitFileClassWithDirectoryStructure()
{
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x/y/foo_bar"}.Build();
diff --git a/src/ProtocolBuffers.Test/CodedInputStreamTest.cs b/src/ProtocolBuffers.Test/CodedInputStreamTest.cs
index 64656b19..ab08df9e 100644
--- a/src/ProtocolBuffers.Test/CodedInputStreamTest.cs
+++ b/src/ProtocolBuffers.Test/CodedInputStreamTest.cs
@@ -38,12 +38,12 @@ using System;
using System.Collections.Generic;
using System.IO;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Diagnostics;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class CodedInputStreamTest
{
/// <summary>
@@ -136,7 +136,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void ReadVarint()
{
AssertReadVarint(Bytes(0x00), 0);
@@ -214,7 +214,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void ReadLittleEndian()
{
AssertReadLittleEndian32(Bytes(0x78, 0x56, 0x34, 0x12), 0x12345678);
@@ -226,7 +226,7 @@ namespace Google.ProtocolBuffers
Bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef012345678UL);
}
- [Test]
+ [TestMethod]
public void DecodeZigZag32()
{
Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(0));
@@ -239,7 +239,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(unchecked((int) 0x80000000), CodedInputStream.DecodeZigZag32(0xFFFFFFFF));
}
- [Test]
+ [TestMethod]
public void DecodeZigZag64()
{
Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(0));
@@ -254,7 +254,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(unchecked((long) 0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL));
}
- [Test]
+ [TestMethod]
public void ReadWholeMessage()
{
TestAllTypes message = TestUtil.GetAllSet();
@@ -272,7 +272,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void SkipWholeMessage()
{
TestAllTypes message = TestUtil.GetAllSet();
@@ -301,7 +301,7 @@ namespace Google.ProtocolBuffers
/// Test that a bug in SkipRawBytes has been fixed: if the skip
/// skips exactly up to a limit, this should bnot break things
/// </summary>
- [Test]
+ [TestMethod]
public void SkipRawBytesBug()
{
byte[] rawBytes = new byte[] {1, 2};
@@ -342,7 +342,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllFieldsSet(message3);
}
- [Test]
+ [TestMethod]
public void ReadMaliciouslyLargeBlob()
{
MemoryStream ms = new MemoryStream();
@@ -400,7 +400,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void MaliciousRecursion()
{
ByteString data64 = MakeRecursiveMessage(64).ToByteString();
@@ -431,7 +431,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void SizeLimit()
{
// Have to use a Stream rather than ByteString.CreateCodedInput as SizeLimit doesn't
@@ -451,7 +451,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void ResetSizeCounter()
{
CodedInputStream input = CodedInputStream.CreateInstance(
@@ -488,7 +488,7 @@ namespace Google.ProtocolBuffers
/// is thrown. Instead, the invalid bytes are replaced with the Unicode
/// "replacement character" U+FFFD.
/// </summary>
- [Test]
+ [TestMethod]
public void ReadInvalidUtf8()
{
MemoryStream ms = new MemoryStream();
@@ -536,7 +536,7 @@ namespace Google.ProtocolBuffers
enum TestNegEnum { None = 0, Value = -2 }
- [Test]
+ [TestMethod]
public void TestNegativeEnum()
{
byte[] bytes = new byte[10] { 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01 };
@@ -549,7 +549,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(TestNegEnum.Value, val);
}
- [Test]
+ [TestMethod]
public void TestNegativeEnumPackedArray()
{
int arraySize = 1 + (10 * 5);
@@ -577,7 +577,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(4, unk.Count);
}
- [Test]
+ [TestMethod]
public void TestNegativeEnumArray()
{
int arraySize = 1 + 1 + (11 * 5);
diff --git a/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs b/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs
index d041d3f0..ce0c57c4 100644
--- a/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs
+++ b/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs
@@ -38,11 +38,11 @@ using System;
using System.Collections.Generic;
using System.IO;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class CodedOutputStreamTest
{
/// <summary>
@@ -58,7 +58,7 @@ namespace Google.ProtocolBuffers
CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput);
output.WriteRawVarint32((uint) value);
output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
+ TestUtil.AssertBytesEqual(data, rawOutput.ToArray());
// Also try computing size.
Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint32Size((uint) value));
}
@@ -68,7 +68,7 @@ namespace Google.ProtocolBuffers
CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput);
output.WriteRawVarint64(value);
output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
+ TestUtil.AssertBytesEqual(data, rawOutput.ToArray());
// Also try computing size.
Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint64Size(value));
@@ -85,7 +85,7 @@ namespace Google.ProtocolBuffers
CodedOutputStream.CreateInstance(rawOutput, bufferSize);
output.WriteRawVarint32((uint) value);
output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
+ TestUtil.AssertBytesEqual(data, rawOutput.ToArray());
}
{
@@ -93,7 +93,7 @@ namespace Google.ProtocolBuffers
CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput, bufferSize);
output.WriteRawVarint64(value);
output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
+ TestUtil.AssertBytesEqual(data, rawOutput.ToArray());
}
}
}
@@ -101,7 +101,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Tests WriteRawVarint32() and WriteRawVarint64()
/// </summary>
- [Test]
+ [TestMethod]
public void WriteVarint()
{
AssertWriteVarint(new byte[] {0x00}, 0);
@@ -143,7 +143,7 @@ namespace Google.ProtocolBuffers
CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput);
output.WriteRawLittleEndian32(value);
output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
+ TestUtil.AssertBytesEqual(data, rawOutput.ToArray());
// Try different buffer sizes.
for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2)
@@ -152,7 +152,7 @@ namespace Google.ProtocolBuffers
output = CodedOutputStream.CreateInstance(rawOutput, bufferSize);
output.WriteRawLittleEndian32(value);
output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
+ TestUtil.AssertBytesEqual(data, rawOutput.ToArray());
}
}
@@ -166,7 +166,7 @@ namespace Google.ProtocolBuffers
CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput);
output.WriteRawLittleEndian64(value);
output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
+ TestUtil.AssertBytesEqual(data, rawOutput.ToArray());
// Try different block sizes.
for (int blockSize = 1; blockSize <= 16; blockSize *= 2)
@@ -175,14 +175,14 @@ namespace Google.ProtocolBuffers
output = CodedOutputStream.CreateInstance(rawOutput, blockSize);
output.WriteRawLittleEndian64(value);
output.Flush();
- Assert.AreEqual(data, rawOutput.ToArray());
+ TestUtil.AssertBytesEqual(data, rawOutput.ToArray());
}
}
/// <summary>
/// Tests writeRawLittleEndian32() and writeRawLittleEndian64().
/// </summary>
- [Test]
+ [TestMethod]
public void WriteLittleEndian()
{
AssertWriteLittleEndian32(new byte[] {0x78, 0x56, 0x34, 0x12}, 0x12345678);
@@ -196,7 +196,8 @@ namespace Google.ProtocolBuffers
0x9abcdef012345678UL);
}
- [Test]
+#if !SILVERLIGHT
+ [TestMethod]
public void WriteWholeMessage()
{
TestAllTypes message = TestUtil.GetAllSet();
@@ -220,7 +221,7 @@ namespace Google.ProtocolBuffers
/// Tests writing a whole message with every packed field type. Ensures the
/// wire format of packed fields is compatible with C++.
/// </summary>
- [Test]
+ [TestMethod]
public void WriteWholePackedFieldsMessage()
{
TestPackedTypes message = TestUtil.GetPackedSet();
@@ -229,34 +230,35 @@ namespace Google.ProtocolBuffers
TestUtil.AssertEqualBytes(TestUtil.GetGoldenPackedFieldsMessage().ToByteArray(),
rawBytes);
}
+#endif
- [Test]
+ [TestMethod]
public void EncodeZigZag32()
{
- Assert.AreEqual(0, CodedOutputStream.EncodeZigZag32(0));
- Assert.AreEqual(1, CodedOutputStream.EncodeZigZag32(-1));
- Assert.AreEqual(2, CodedOutputStream.EncodeZigZag32(1));
- Assert.AreEqual(3, CodedOutputStream.EncodeZigZag32(-2));
- Assert.AreEqual(0x7FFFFFFE, CodedOutputStream.EncodeZigZag32(0x3FFFFFFF));
- Assert.AreEqual(0x7FFFFFFF, CodedOutputStream.EncodeZigZag32(unchecked((int) 0xC0000000)));
- Assert.AreEqual(0xFFFFFFFE, CodedOutputStream.EncodeZigZag32(0x7FFFFFFF));
- Assert.AreEqual(0xFFFFFFFF, CodedOutputStream.EncodeZigZag32(unchecked((int) 0x80000000)));
+ Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag32(0));
+ Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag32(-1));
+ Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag32(1));
+ Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag32(-2));
+ Assert.AreEqual(0x7FFFFFFEu, CodedOutputStream.EncodeZigZag32(0x3FFFFFFF));
+ Assert.AreEqual(0x7FFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0xC0000000)));
+ Assert.AreEqual(0xFFFFFFFEu, CodedOutputStream.EncodeZigZag32(0x7FFFFFFF));
+ Assert.AreEqual(0xFFFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0x80000000)));
}
- [Test]
+ [TestMethod]
public void EncodeZigZag64()
{
- Assert.AreEqual(0, CodedOutputStream.EncodeZigZag64(0));
- Assert.AreEqual(1, CodedOutputStream.EncodeZigZag64(-1));
- Assert.AreEqual(2, CodedOutputStream.EncodeZigZag64(1));
- Assert.AreEqual(3, CodedOutputStream.EncodeZigZag64(-2));
- Assert.AreEqual(0x000000007FFFFFFEL,
+ Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag64(0));
+ Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag64(-1));
+ Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag64(1));
+ Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag64(-2));
+ Assert.AreEqual(0x000000007FFFFFFEuL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL)));
- Assert.AreEqual(0x000000007FFFFFFFL,
+ Assert.AreEqual(0x000000007FFFFFFFuL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL)));
- Assert.AreEqual(0x00000000FFFFFFFEL,
+ Assert.AreEqual(0x00000000FFFFFFFEuL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL)));
- Assert.AreEqual(0x00000000FFFFFFFFL,
+ Assert.AreEqual(0x00000000FFFFFFFFuL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL)));
Assert.AreEqual(0xFFFFFFFFFFFFFFFEL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL)));
@@ -264,7 +266,7 @@ namespace Google.ProtocolBuffers
CodedOutputStream.EncodeZigZag64(unchecked((long) 0x8000000000000000UL)));
}
- [Test]
+ [TestMethod]
public void RoundTripZigZag32()
{
// Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1)
@@ -276,7 +278,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-3612)));
}
- [Test]
+ [TestMethod]
public void RoundTripZigZag64()
{
Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(0)));
@@ -291,7 +293,7 @@ namespace Google.ProtocolBuffers
CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-75123905439571256L)));
}
- [Test]
+ [TestMethod]
public void TestNegativeEnumNoTag()
{
Assert.AreEqual(10, CodedOutputStream.ComputeInt32SizeNoTag(-2));
@@ -305,7 +307,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes));
}
- [Test]
+ [TestMethod]
public void TestNegativeEnumWithTag()
{
Assert.AreEqual(11, CodedOutputStream.ComputeInt32Size(8, -2));
@@ -320,7 +322,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("40-FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes));
}
- [Test]
+ [TestMethod]
public void TestNegativeEnumArrayPacked()
{
int arraySize = 1 + (10 * 5);
@@ -344,7 +346,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(i, values[Math.Abs(i)]);
}
- [Test]
+ [TestMethod]
public void TestNegativeEnumArray()
{
int arraySize = 1 + 1 + (11 * 5);
diff --git a/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs b/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs
index 35b13a1d..0bce60d9 100644
--- a/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs
+++ b/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs
@@ -36,29 +36,27 @@
using System;
using System.Collections.Generic;
-using NUnit.Framework;
-
-internal delegate void Action();
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers.Collections
{
- [TestFixture]
+ [TestClass]
public class PopsicleListTest
{
- [Test]
+ [TestMethod]
public void MutatingOperationsOnFrozenList()
{
PopsicleList<string> list = new PopsicleList<string>();
list.MakeReadOnly();
- AssertNotSupported(() => list.Add(""));
- AssertNotSupported(() => list.Clear());
- AssertNotSupported(() => list.Insert(0, ""));
- AssertNotSupported(() => list.Remove(""));
- AssertNotSupported(() => list.RemoveAt(0));
- AssertNotSupported(() => list.Add(new[] {"", ""}));
+ TestUtil.AssertNotSupported(() => list.Add(""));
+ TestUtil.AssertNotSupported(() => list.Clear());
+ TestUtil.AssertNotSupported(() => list.Insert(0, ""));
+ TestUtil.AssertNotSupported(() => list.Remove(""));
+ TestUtil.AssertNotSupported(() => list.RemoveAt(0));
+ TestUtil.AssertNotSupported(() => list.Add(new[] { "", "" }));
}
- [Test]
+ [TestMethod]
public void NonMutatingOperationsOnFrozenList()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -71,7 +69,7 @@ namespace Google.ProtocolBuffers.Collections
Assert.IsTrue(list.IsReadOnly);
}
- [Test]
+ [TestMethod]
public void MutatingOperationsOnFluidList()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -83,7 +81,7 @@ namespace Google.ProtocolBuffers.Collections
list.RemoveAt(0);
}
- [Test]
+ [TestMethod]
public void NonMutatingOperationsOnFluidList()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -95,7 +93,7 @@ namespace Google.ProtocolBuffers.Collections
Assert.IsFalse(list.IsReadOnly);
}
- [Test]
+ [TestMethod]
public void DoesNotAddNullEnumerable()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -109,7 +107,7 @@ namespace Google.ProtocolBuffers.Collections
Assert.Fail("List should not allow nulls.");
}
- [Test]
+ [TestMethod]
public void DoesNotAddRangeWithNull()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -123,7 +121,7 @@ namespace Google.ProtocolBuffers.Collections
Assert.Fail("List should not allow nulls.");
}
- [Test]
+ [TestMethod]
public void DoesNotAddNull()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -137,7 +135,7 @@ namespace Google.ProtocolBuffers.Collections
Assert.Fail("List should not allow nulls.");
}
- [Test]
+ [TestMethod]
public void DoesNotSetNull()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -151,19 +149,5 @@ namespace Google.ProtocolBuffers.Collections
Assert.Fail("List should not allow nulls.");
}
-
-
- private static void AssertNotSupported(Action action)
- {
- try
- {
- action();
- Assert.Fail("Expected NotSupportedException");
- }
- catch (NotSupportedException)
- {
- // Expected
- }
- }
}
} \ No newline at end of file
diff --git a/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs
index e993efad..8438d94f 100644
--- a/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs
+++ b/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs
@@ -1,20 +1,26 @@
using System;
-using NUnit.Framework;
+#if SILVERLIGHT
+using TestClass = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute;
+using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute;
+using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
+#else
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+#endif
namespace Google.ProtocolBuffers.Compatibility
{
- [TestFixture]
+ [TestClass]
public class BinaryCompatibilityTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
{
byte[] bresult = message.ToByteArray();
- return bresult;
+ return Convert.ToBase64String(bresult);
}
protected override TBuilder DeserializeMessage<TMessage, TBuilder>(object message, TBuilder builder, ExtensionRegistry registry)
{
- return builder.MergeFrom((byte[])message, registry);
+ return builder.MergeFrom((byte[])Convert.FromBase64String((string)message), registry);
}
}
} \ No newline at end of file
diff --git a/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs
index 9b117f6f..f47a6a52 100644
--- a/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs
+++ b/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs
@@ -1,6 +1,7 @@
using System;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
namespace Google.ProtocolBuffers.Compatibility
{
@@ -21,10 +22,10 @@ namespace Google.ProtocolBuffers.Compatibility
protected virtual void AssertOutputEquals(object lhs, object rhs)
{
- Assert.AreEqual(lhs, rhs);
+ Assert.AreEqual<object>(lhs, rhs);
}
- [Test]
+ [TestMethod]
public virtual void RoundTripMessage1OptimizeSize()
{
SizeMessage1 msg = SizeMessage1.CreateBuilder().MergeFrom(TestResources.google_message1).Build();
@@ -34,10 +35,10 @@ namespace Google.ProtocolBuffers.Compatibility
Assert.AreEqual(msg, copy);
AssertOutputEquals(content, SerializeMessage<SizeMessage1, SizeMessage1.Builder>(copy));
- Assert.AreEqual(TestResources.google_message1, copy.ToByteArray());
+ Assert.AreEqual(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray()));
}
- [Test]
+ [TestMethod]
public virtual void RoundTripMessage2OptimizeSize()
{
SizeMessage2 msg = SizeMessage2.CreateBuilder().MergeFrom(TestResources.google_message2).Build();
@@ -47,10 +48,10 @@ namespace Google.ProtocolBuffers.Compatibility
Assert.AreEqual(msg, copy);
AssertOutputEquals(content, SerializeMessage<SizeMessage2, SizeMessage2.Builder>(copy));
- Assert.AreEqual(TestResources.google_message2, copy.ToByteArray());
+ Assert.AreEqual(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray()));
}
- [Test]
+ [TestMethod]
public virtual void RoundTripMessage1OptimizeSpeed()
{
SpeedMessage1 msg = SpeedMessage1.CreateBuilder().MergeFrom(TestResources.google_message1).Build();
@@ -60,10 +61,10 @@ namespace Google.ProtocolBuffers.Compatibility
Assert.AreEqual(msg, copy);
AssertOutputEquals(content, SerializeMessage<SpeedMessage1, SpeedMessage1.Builder>(copy));
- Assert.AreEqual(TestResources.google_message1, copy.ToByteArray());
+ Assert.AreEqual(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray()));
}
- [Test]
+ [TestMethod]
public virtual void RoundTripMessage2OptimizeSpeed()
{
SpeedMessage2 msg = SpeedMessage2.CreateBuilder().MergeFrom(TestResources.google_message2).Build();
@@ -73,7 +74,7 @@ namespace Google.ProtocolBuffers.Compatibility
Assert.AreEqual(msg, copy);
AssertOutputEquals(content, SerializeMessage<SpeedMessage2, SpeedMessage2.Builder>(copy));
- Assert.AreEqual(TestResources.google_message2, copy.ToByteArray());
+ Assert.AreEqual(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray()));
}
#region Test message builders
@@ -150,7 +151,7 @@ namespace Google.ProtocolBuffers.Compatibility
#endregion
- [Test]
+ [TestMethod]
public void TestRoundTripAllTypes()
{
TestAllTypes msg = AddAllTypes(new TestAllTypes.Builder()).Build();
@@ -160,10 +161,10 @@ namespace Google.ProtocolBuffers.Compatibility
Assert.AreEqual(msg, copy);
AssertOutputEquals(content, SerializeMessage<TestAllTypes, TestAllTypes.Builder>(copy));
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray()));
}
- [Test]
+ [TestMethod]
public void TestRoundTripRepeatedTypes()
{
TestAllTypes msg = AddRepeatedTypes(new TestAllTypes.Builder(), 5).Build();
@@ -173,10 +174,10 @@ namespace Google.ProtocolBuffers.Compatibility
Assert.AreEqual(msg, copy);
AssertOutputEquals(content, SerializeMessage<TestAllTypes, TestAllTypes.Builder>(copy));
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray()));
}
- [Test]
+ [TestMethod]
public void TestRoundTripPackedTypes()
{
TestPackedTypes msg = AddPackedTypes(new TestPackedTypes.Builder(), 5).Build();
@@ -186,7 +187,7 @@ namespace Google.ProtocolBuffers.Compatibility
Assert.AreEqual(msg, copy);
AssertOutputEquals(content, SerializeMessage<TestPackedTypes, TestPackedTypes.Builder>(copy));
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray()));
}
}
}
diff --git a/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs
index 188c5bc3..fddddf84 100644
--- a/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs
+++ b/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs
@@ -3,11 +3,18 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
using Google.ProtocolBuffers.Serialization;
-using NUnit.Framework;
+#if SILVERLIGHT
+using TestClass = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute;
+using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute;
+using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
+#else
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+#endif
+
namespace Google.ProtocolBuffers.Compatibility
{
- [TestFixture]
+ [TestClass]
public class DictionaryCompatibilityTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
diff --git a/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs
index 6b368b7d..74603108 100644
--- a/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs
+++ b/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs
@@ -1,11 +1,11 @@
using System.IO;
using System.Text;
using Google.ProtocolBuffers.Serialization;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers.Compatibility
{
- [TestFixture]
+ [TestClass]
public class JsonCompatibilityTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
@@ -23,7 +23,7 @@ namespace Google.ProtocolBuffers.Compatibility
}
}
- [TestFixture]
+ [TestClass]
public class JsonCompatibilityFormattedTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
diff --git a/src/ProtocolBuffers.Test/Compatibility/TestResources.cs b/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
index 2581c7bf..2fc1322b 100644
--- a/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
+++ b/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
@@ -2,7 +2,14 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
-using NUnit.Framework;
+#if SILVERLIGHT
+using TestClass = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute;
+using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute;
+using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
+#else
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+#endif
+
namespace Google.ProtocolBuffers.Compatibility
{
diff --git a/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs
index defec28e..9c0afe46 100644
--- a/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs
+++ b/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs
@@ -1,10 +1,10 @@
using System.ComponentModel;
using System.IO;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers.Compatibility
{
- [TestFixture]
+ [TestClass]
public class TextCompatibilityTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
@@ -20,16 +20,16 @@ namespace Google.ProtocolBuffers.Compatibility
return builder;
}
- [Test, Explicit, Description("This test can take a very long time to run.")]
+ [TestMethod, System.ComponentModel.Description("This test can take a very long time to run.")]
public override void RoundTripMessage2OptimizeSize()
{
- base.RoundTripMessage2OptimizeSize();
+ //base.RoundTripMessage2OptimizeSize();
}
- [Test, Explicit, Description("This test can take a very long time to run.")]
+ [TestMethod, System.ComponentModel.Description("This test can take a very long time to run.")]
public override void RoundTripMessage2OptimizeSpeed()
{
- base.RoundTripMessage2OptimizeSpeed();
+ //base.RoundTripMessage2OptimizeSpeed();
}
}
} \ No newline at end of file
diff --git a/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs
index 62b9456a..9113b589 100644
--- a/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs
+++ b/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs
@@ -2,11 +2,18 @@ using System.IO;
using System.Xml;
using Google.ProtocolBuffers.Serialization;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+#if SILVERLIGHT
+using TestClass = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute;
+using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute;
+using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
+#else
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+#endif
+
namespace Google.ProtocolBuffers.Compatibility
{
- [TestFixture]
+ [TestClass]
public class XmlCompatibilityTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
@@ -24,7 +31,7 @@ namespace Google.ProtocolBuffers.Compatibility
}
}
- [TestFixture]
+ [TestClass]
public class XmlCompatibilityFormattedTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
diff --git a/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs b/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs
index 44e7914f..6035c405 100644
--- a/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs
+++ b/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs
@@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.Reflection;
using System.Text;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using UnitTest.Issues.TestProtos;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class DeprecatedMemberTest
{
private static void AssertIsDeprecated(ICustomAttributeProvider member)
@@ -16,7 +16,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member);
}
- [Test]
+ [TestMethod]
public void TestDepreatedPrimitiveValue()
{
AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasPrimitiveValue"));
@@ -27,7 +27,7 @@ namespace Google.ProtocolBuffers
AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearPrimitiveValue"));
AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetPrimitiveValue"));
}
- [Test]
+ [TestMethod]
public void TestDepreatedPrimitiveArray()
{
AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("PrimitiveArrayList"));
@@ -42,7 +42,7 @@ namespace Google.ProtocolBuffers
AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddRangePrimitiveArray"));
AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearPrimitiveArray"));
}
- [Test]
+ [TestMethod]
public void TestDepreatedMessageValue()
{
AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasMessageValue"));
@@ -55,7 +55,7 @@ namespace Google.ProtocolBuffers
AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetMessageValue", new[] { typeof(DeprecatedChild) }));
AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetMessageValue", new[] { typeof(DeprecatedChild.Builder) }));
}
- [Test]
+ [TestMethod]
public void TestDepreatedMessageArray()
{
AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("MessageArrayList"));
@@ -72,7 +72,7 @@ namespace Google.ProtocolBuffers
AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddRangeMessageArray"));
AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearMessageArray"));
}
- [Test]
+ [TestMethod]
public void TestDepreatedEnumValue()
{
AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasEnumValue"));
@@ -83,7 +83,7 @@ namespace Google.ProtocolBuffers
AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearEnumValue"));
AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetEnumValue"));
}
- [Test]
+ [TestMethod]
public void TestDepreatedEnumArray()
{
AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("EnumArrayList"));
diff --git a/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs b/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs
index d536db2d..79033e6e 100644
--- a/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs
+++ b/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs
@@ -34,36 +34,36 @@
#endregion
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using Google.ProtocolBuffers.TestProtos;
namespace Google.ProtocolBuffers.Descriptors
{
- [TestFixture]
+ [TestClass]
public class MessageDescriptorTest
{
- [Test]
+ [TestMethod]
public void FindPropertyWithDefaultName()
{
Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.NormalFieldNumber),
OptionsMessage.Descriptor.FindFieldByPropertyName("Normal"));
}
- [Test]
+ [TestMethod]
public void FindPropertyWithAutoModifiedName()
{
Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.OptionsMessage_FieldNumber),
OptionsMessage.Descriptor.FindFieldByPropertyName("OptionsMessage_"));
}
- [Test]
+ [TestMethod]
public void FindPropertyWithCustomizedName()
{
Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.CustomNameFieldNumber),
OptionsMessage.Descriptor.FindFieldByPropertyName("CustomName"));
}
- [Test]
+ [TestMethod]
public void FindPropertyWithInvalidName()
{
Assert.IsNull(OptionsMessage.Descriptor.FindFieldByPropertyName("Bogus"));
diff --git a/src/ProtocolBuffers.Test/DescriptorsTest.cs b/src/ProtocolBuffers.Test/DescriptorsTest.cs
index 671fb5a8..5cf79e3b 100644
--- a/src/ProtocolBuffers.Test/DescriptorsTest.cs
+++ b/src/ProtocolBuffers.Test/DescriptorsTest.cs
@@ -37,7 +37,7 @@
using System.Text;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
@@ -45,10 +45,10 @@ namespace Google.ProtocolBuffers
/// Tests for descriptors. (Not in its own namespace or broken up into individual classes as the
/// size doesn't warrant it. On the other hand, this makes me feel a bit dirty...)
/// </summary>
- [TestFixture]
+ [TestClass]
public class DescriptorsTest
{
- [Test]
+ [TestMethod]
public void FileDescriptor()
{
FileDescriptor file = UnitTestProtoFile.Descriptor;
@@ -109,7 +109,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void MessageDescriptor()
{
MessageDescriptor messageType = TestAllTypes.Descriptor;
@@ -154,7 +154,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void FieldDescriptor()
{
MessageDescriptor messageType = TestAllTypes.Descriptor;
@@ -212,7 +212,7 @@ namespace Google.ProtocolBuffers
nestedExtension.ExtensionScope);
}
- [Test]
+ [TestMethod]
public void FieldDescriptorLabel()
{
FieldDescriptor requiredField =
@@ -229,25 +229,25 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(repeatedField.IsRequired);
Assert.IsTrue(repeatedField.IsRepeated);
}
-
- [Test]
+#if !SILVERLIGHT
+ [TestMethod]
public void FieldDescriptorDefault()
{
MessageDescriptor d = TestAllTypes.Descriptor;
Assert.IsFalse(d.FindDescriptor<FieldDescriptor>("optional_int32").HasDefaultValue);
- Assert.AreEqual(0, d.FindDescriptor<FieldDescriptor>("optional_int32").DefaultValue);
+ Assert.AreEqual<object>(0, d.FindDescriptor<FieldDescriptor>("optional_int32").DefaultValue);
Assert.IsTrue(d.FindDescriptor<FieldDescriptor>("default_int32").HasDefaultValue);
- Assert.AreEqual(41, d.FindDescriptor<FieldDescriptor>("default_int32").DefaultValue);
+ Assert.AreEqual<object>(41, d.FindDescriptor<FieldDescriptor>("default_int32").DefaultValue);
d = TestExtremeDefaultValues.Descriptor;
- Assert.AreEqual(
- ByteString.CopyFrom("\u0000\u0001\u0007\b\f\n\r\t\u000b\\\'\"\u00fe", Encoding.GetEncoding(28591)),
+ Assert.AreEqual<object>(
+ ByteString.CopyFrom("\u0000\u0001\u0007\b\f\n\r\t\u000b\\\'\"\u00fe", Encoding.GetEncoding("iso-8859-1")),
d.FindDescriptor<FieldDescriptor>("escaped_bytes").DefaultValue);
- Assert.AreEqual(uint.MaxValue, d.FindDescriptor<FieldDescriptor>("large_uint32").DefaultValue);
- Assert.AreEqual(ulong.MaxValue, d.FindDescriptor<FieldDescriptor>("large_uint64").DefaultValue);
+ Assert.AreEqual<object>(uint.MaxValue, d.FindDescriptor<FieldDescriptor>("large_uint32").DefaultValue);
+ Assert.AreEqual<object>(ulong.MaxValue, d.FindDescriptor<FieldDescriptor>("large_uint64").DefaultValue);
}
-
- [Test]
+#endif
+ [TestMethod]
public void EnumDescriptor()
{
// Note: this test is a bit different to the Java version because there's no static way of getting to the descriptor
@@ -280,7 +280,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void ServiceDescriptor()
{
ServiceDescriptor service = TestGenericService.Descriptor;
@@ -311,7 +311,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void CustomOptions()
{
MessageDescriptor descriptor = TestMessageWithCustomOptions.Descriptor;
@@ -323,7 +323,7 @@ namespace Google.ProtocolBuffers
Assert.IsNotNull(field);
Assert.IsTrue(field.Options.HasExtension(UnitTestCustomOptionsProtoFile.FieldOpt1));
- Assert.AreEqual(8765432109L, field.Options.GetExtension(UnitTestCustomOptionsProtoFile.FieldOpt1));
+ Assert.AreEqual(8765432109uL, field.Options.GetExtension(UnitTestCustomOptionsProtoFile.FieldOpt1));
// TODO: Write out enum descriptors
/*
diff --git a/src/ProtocolBuffers.Test/DynamicMessageTest.cs b/src/ProtocolBuffers.Test/DynamicMessageTest.cs
index b6c8178a..92515999 100644
--- a/src/ProtocolBuffers.Test/DynamicMessageTest.cs
+++ b/src/ProtocolBuffers.Test/DynamicMessageTest.cs
@@ -37,18 +37,18 @@
using System;
using System.Collections.Generic;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class DynamicMessageTest
{
private ReflectionTester reflectionTester;
private ReflectionTester extensionsReflectionTester;
private ReflectionTester packedReflectionTester;
- [SetUp]
+ [TestInitialize]
public void SetUp()
{
reflectionTester = ReflectionTester.CreateTestAllTypesInstance();
@@ -56,7 +56,7 @@ namespace Google.ProtocolBuffers
packedReflectionTester = ReflectionTester.CreateTestPackedTypesInstance();
}
- [Test]
+ [TestMethod]
public void DynamicMessageAccessors()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
@@ -65,7 +65,7 @@ namespace Google.ProtocolBuffers
reflectionTester.AssertAllFieldsSetViaReflection(message);
}
- [Test]
+ [TestMethod]
public void DoubleBuildError()
{
DynamicMessage.Builder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
@@ -81,14 +81,14 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void DynamicMessageSettersRejectNull()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
reflectionTester.AssertReflectionSettersRejectNull(builder);
}
- [Test]
+ [TestMethod]
public void DynamicMessageExtensionAccessors()
{
// We don't need to extensively test DynamicMessage's handling of
@@ -100,14 +100,14 @@ namespace Google.ProtocolBuffers
extensionsReflectionTester.AssertAllFieldsSetViaReflection(message);
}
- [Test]
+ [TestMethod]
public void DynamicMessageExtensionSettersRejectNull()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllExtensions.Descriptor);
extensionsReflectionTester.AssertReflectionSettersRejectNull(builder);
}
- [Test]
+ [TestMethod]
public void DynamicMessageRepeatedSetters()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
@@ -117,21 +117,21 @@ namespace Google.ProtocolBuffers
reflectionTester.AssertRepeatedFieldsModifiedViaReflection(message);
}
- [Test]
+ [TestMethod]
public void DynamicMessageRepeatedSettersRejectNull()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
reflectionTester.AssertReflectionRepeatedSettersRejectNull(builder);
}
- [Test]
+ [TestMethod]
public void DynamicMessageDefaults()
{
reflectionTester.AssertClearViaReflection(DynamicMessage.GetDefaultInstance(TestAllTypes.Descriptor));
reflectionTester.AssertClearViaReflection(DynamicMessage.CreateBuilder(TestAllTypes.Descriptor).Build());
}
- [Test]
+ [TestMethod]
public void DynamicMessageSerializedSize()
{
TestAllTypes message = TestUtil.GetAllSet();
@@ -143,7 +143,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(message.SerializedSize, dynamicMessage.SerializedSize);
}
- [Test]
+ [TestMethod]
public void DynamicMessageSerialization()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
@@ -159,7 +159,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(TestUtil.GetAllSet().ToByteString(), rawBytes);
}
- [Test]
+ [TestMethod]
public void DynamicMessageParsing()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -172,7 +172,7 @@ namespace Google.ProtocolBuffers
reflectionTester.AssertAllFieldsSetViaReflection(message2);
}
- [Test]
+ [TestMethod]
public void DynamicMessagePackedSerialization()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestPackedTypes.Descriptor);
@@ -188,7 +188,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(TestUtil.GetPackedSet().ToByteString(), rawBytes);
}
- [Test]
+ [TestMethod]
public void testDynamicMessagePackedParsing()
{
TestPackedTypes.Builder builder = TestPackedTypes.CreateBuilder();
@@ -201,7 +201,7 @@ namespace Google.ProtocolBuffers
packedReflectionTester.AssertPackedFieldsSetViaReflection(message2);
}
- [Test]
+ [TestMethod]
public void DynamicMessageCopy()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -212,7 +212,7 @@ namespace Google.ProtocolBuffers
reflectionTester.AssertAllFieldsSetViaReflection(copy);
}
- [Test]
+ [TestMethod]
public void ToBuilder()
{
DynamicMessage.Builder builder =
diff --git a/src/ProtocolBuffers.Test/ExtendableMessageTest.cs b/src/ProtocolBuffers.Test/ExtendableMessageTest.cs
index 29423ff2..f7d670f9 100644
--- a/src/ProtocolBuffers.Test/ExtendableMessageTest.cs
+++ b/src/ProtocolBuffers.Test/ExtendableMessageTest.cs
@@ -38,21 +38,21 @@ using System;
using System.Collections.Generic;
using Google.ProtocolBuffers;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class ExtendableMessageTest
{
- [Test, ExpectedException(typeof (ArgumentException))]
+ [TestMethod, ExpectedException(typeof (ArgumentException))]
public void ExtensionWriterInvalidExtension()
{
TestPackedExtensions.CreateBuilder()[UnitTestProtoFile.OptionalForeignMessageExtension.Descriptor] =
ForeignMessage.DefaultInstance;
}
- [Test]
+ [TestMethod]
public void ExtensionWriterTest()
{
TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder()
@@ -128,7 +128,7 @@ namespace Google.ProtocolBuffers
registry);
TestAllExtensions copy = copyBuilder.Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
Assert.AreEqual(true, copy.GetExtension(UnitTestProtoFile.DefaultBoolExtension));
Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnitTestProtoFile.DefaultBytesExtension));
diff --git a/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs b/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs
index b1290031..cd870054 100644
--- a/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs
+++ b/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs
@@ -2,11 +2,11 @@
using System.Collections.Generic;
using System.Text;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class GeneratedBuilderTest
{
class OneTimeEnumerator<T> : IEnumerable<T>
@@ -27,7 +27,7 @@ namespace Google.ProtocolBuffers
{ return GetEnumerator(); }
}
- [Test]
+ [TestMethod]
public void DoesNotEnumerateTwiceForMessageList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
@@ -35,19 +35,19 @@ namespace Google.ProtocolBuffers
new OneTimeEnumerator<ForeignMessage>(
ForeignMessage.DefaultInstance));
}
- [Test]
+ [TestMethod]
public void DoesNotEnumerateTwiceForPrimitiveList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRangeRepeatedInt32(new OneTimeEnumerator<int>(1));
}
- [Test]
+ [TestMethod]
public void DoesNotEnumerateTwiceForStringList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRangeRepeatedString(new OneTimeEnumerator<string>("test"));
}
- [Test]
+ [TestMethod]
public void DoesNotEnumerateTwiceForEnumList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
@@ -69,7 +69,7 @@ namespace Google.ProtocolBuffers
Assert.Fail("Expected exception of type " + typeof(T));
}
- [Test]
+ [TestMethod]
public void DoesNotAddNullToMessageListByAddRange()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
@@ -77,7 +77,7 @@ namespace Google.ProtocolBuffers
() => b.AddRangeRepeatedForeignMessage(new ForeignMessage[] { null })
);
}
- [Test]
+ [TestMethod]
public void DoesNotAddNullToMessageListByAdd()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
@@ -85,7 +85,7 @@ namespace Google.ProtocolBuffers
() => b.AddRepeatedForeignMessage((ForeignMessage)null)
);
}
- [Test]
+ [TestMethod]
public void DoesNotAddNullToMessageListBySet()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
@@ -94,7 +94,7 @@ namespace Google.ProtocolBuffers
() => b.SetRepeatedForeignMessage(0, (ForeignMessage)null)
);
}
- [Test]
+ [TestMethod]
public void DoesNotAddNullToStringListByAddRange()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
@@ -102,7 +102,7 @@ namespace Google.ProtocolBuffers
() => b.AddRangeRepeatedString(new String[] { null })
);
}
- [Test]
+ [TestMethod]
public void DoesNotAddNullToStringListByAdd()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
@@ -110,7 +110,7 @@ namespace Google.ProtocolBuffers
() => b.AddRepeatedString(null)
);
}
- [Test]
+ [TestMethod]
public void DoesNotAddNullToStringListBySet()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
diff --git a/src/ProtocolBuffers.Test/GeneratedMessageTest.cs b/src/ProtocolBuffers.Test/GeneratedMessageTest.cs
index 12224e9b..5fb4f4db 100644
--- a/src/ProtocolBuffers.Test/GeneratedMessageTest.cs
+++ b/src/ProtocolBuffers.Test/GeneratedMessageTest.cs
@@ -38,31 +38,31 @@ using System;
using System.Collections.Generic;
using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class GeneratedMessageTest
{
private ReflectionTester reflectionTester;
private ReflectionTester extensionsReflectionTester;
- [SetUp]
+ [TestInitialize]
public void SetUp()
{
reflectionTester = ReflectionTester.CreateTestAllTypesInstance();
extensionsReflectionTester = ReflectionTester.CreateTestAllExtensionsInstance();
}
- [Test]
+ [TestMethod]
public void RepeatedAddPrimitiveBeforeBuild()
{
TestAllTypes message = new TestAllTypes.Builder {RepeatedInt32List = {1, 2, 3}}.Build();
TestUtil.AssertEqual(new int[] {1, 2, 3}, message.RepeatedInt32List);
}
- [Test]
+ [TestMethod]
public void AddPrimitiveFailsAfterBuild()
{
TestAllTypes.Builder builder = new TestAllTypes.Builder();
@@ -81,7 +81,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void RepeatedAddMessageBeforeBuild()
{
TestAllTypes message = new TestAllTypes.Builder
@@ -93,7 +93,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(10, message.RepeatedNestedMessageList[0].Bb);
}
- [Test]
+ [TestMethod]
public void AddMessageFailsAfterBuild()
{
TestAllTypes.Builder builder = new TestAllTypes.Builder();
@@ -111,14 +111,14 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void DefaultInstance()
{
Assert.AreSame(TestAllTypes.DefaultInstance, TestAllTypes.DefaultInstance.DefaultInstanceForType);
Assert.AreSame(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().DefaultInstanceForType);
}
- [Test]
+ [TestMethod]
public void Accessors()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -127,7 +127,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllFieldsSet(message);
}
- [Test]
+ [TestMethod]
public void SettersRejectNull()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -145,7 +145,7 @@ namespace Google.ProtocolBuffers
() => builder.AddRepeatedNestedMessage((TestAllTypes.Types.NestedMessage.Builder) null));
}
- [Test]
+ [TestMethod]
public void RepeatedSetters()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -155,7 +155,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertRepeatedFieldsModified(message);
}
- [Test]
+ [TestMethod]
public void RepeatedAppend()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -173,7 +173,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(12, message.GetRepeatedForeignMessage(0).C);
}
- [Test]
+ [TestMethod]
public void RepeatedAppendRejectsNull()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -188,7 +188,7 @@ namespace Google.ProtocolBuffers
() => builder.AddRangeRepeatedBytes(new[] {TestUtil.ToBytes("one"), null}));
}
- [Test]
+ [TestMethod]
public void SettingForeignMessageUsingBuilder()
{
TestAllTypes message = TestAllTypes.CreateBuilder()
@@ -202,7 +202,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(expectedMessage, message);
}
- [Test]
+ [TestMethod]
public void SettingRepeatedForeignMessageUsingBuilder()
{
TestAllTypes message = TestAllTypes.CreateBuilder()
@@ -216,7 +216,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(expectedMessage, message);
}
- [Test]
+ [TestMethod]
public void SettingRepeatedValuesUsingRangeInCollectionInitializer()
{
int[] values = {1, 2, 3};
@@ -227,7 +227,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(Lists.Equals(values, message.RepeatedSint32List));
}
- [Test]
+ [TestMethod]
public void SettingRepeatedValuesUsingIndividualValuesInCollectionInitializer()
{
TestAllTypes message = new TestAllTypes.Builder
@@ -237,7 +237,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(Lists.Equals(new int[] {6, 7}, message.RepeatedSint32List));
}
- [Test]
+ [TestMethod]
public void Defaults()
{
TestUtil.AssertClear(TestAllTypes.DefaultInstance);
@@ -246,7 +246,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("\u1234", TestExtremeDefaultValues.DefaultInstance.Utf8String);
}
- [Test]
+ [TestMethod]
public void ReflectionGetters()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -255,7 +255,7 @@ namespace Google.ProtocolBuffers
reflectionTester.AssertAllFieldsSetViaReflection(message);
}
- [Test]
+ [TestMethod]
public void ReflectionSetters()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -264,14 +264,14 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllFieldsSet(message);
}
- [Test]
+ [TestMethod]
public void ReflectionSettersRejectNull()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
reflectionTester.AssertReflectionSettersRejectNull(builder);
}
- [Test]
+ [TestMethod]
public void ReflectionRepeatedSetters()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -281,14 +281,14 @@ namespace Google.ProtocolBuffers
TestUtil.AssertRepeatedFieldsModified(message);
}
- [Test]
+ [TestMethod]
public void TestReflectionRepeatedSettersRejectNull()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
reflectionTester.AssertReflectionRepeatedSettersRejectNull(builder);
}
- [Test]
+ [TestMethod]
public void ReflectionDefaults()
{
TestUtil.TestInMultipleCultures(() =>
@@ -303,7 +303,7 @@ namespace Google.ProtocolBuffers
// =================================================================
// Extensions.
- [Test]
+ [TestMethod]
public void ExtensionAccessors()
{
TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
@@ -312,7 +312,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllExtensionsSet(message);
}
- [Test]
+ [TestMethod]
public void ExtensionRepeatedSetters()
{
TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
@@ -322,14 +322,14 @@ namespace Google.ProtocolBuffers
TestUtil.AssertRepeatedExtensionsModified(message);
}
- [Test]
+ [TestMethod]
public void ExtensionDefaults()
{
TestUtil.AssertExtensionsClear(TestAllExtensions.DefaultInstance);
TestUtil.AssertExtensionsClear(TestAllExtensions.CreateBuilder().Build());
}
- [Test]
+ [TestMethod]
public void ExtensionReflectionGetters()
{
TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
@@ -338,7 +338,7 @@ namespace Google.ProtocolBuffers
extensionsReflectionTester.AssertAllFieldsSetViaReflection(message);
}
- [Test]
+ [TestMethod]
public void ExtensionReflectionSetters()
{
TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
@@ -347,14 +347,14 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllExtensionsSet(message);
}
- [Test]
+ [TestMethod]
public void ExtensionReflectionSettersRejectNull()
{
TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
extensionsReflectionTester.AssertReflectionSettersRejectNull(builder);
}
- [Test]
+ [TestMethod]
public void ExtensionReflectionRepeatedSetters()
{
TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
@@ -364,14 +364,14 @@ namespace Google.ProtocolBuffers
TestUtil.AssertRepeatedExtensionsModified(message);
}
- [Test]
+ [TestMethod]
public void ExtensionReflectionRepeatedSettersRejectNull()
{
TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
extensionsReflectionTester.AssertReflectionRepeatedSettersRejectNull(builder);
}
- [Test]
+ [TestMethod]
public void ExtensionReflectionDefaults()
{
TestUtil.TestInMultipleCultures(() =>
@@ -383,7 +383,7 @@ namespace Google.ProtocolBuffers
});
}
- [Test]
+ [TestMethod]
public void ClearExtension()
{
// ClearExtension() is not actually used in TestUtil, so try it manually.
@@ -397,7 +397,7 @@ namespace Google.ProtocolBuffers
.GetExtensionCount(UnitTestProtoFile.RepeatedInt32Extension));
}
- [Test]
+ [TestMethod]
public void ExtensionMergeFrom()
{
TestAllExtensions original = TestAllExtensions.CreateBuilder()
@@ -409,7 +409,7 @@ namespace Google.ProtocolBuffers
}
/* Removed multiple files option for the moment
- [Test]
+ [TestMethod]
public void MultipleFilesOption() {
// We mostly just want to check that things compile.
MessageWithNoOuter message = MessageWithNoOuter.CreateBuilder()
@@ -431,7 +431,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(TestAllExtensions.DefaultInstance.HasExtension(MultiFileProto.ExtensionWithOuter));
}*/
- [Test]
+ [TestMethod]
public void OptionalFieldWithRequiredSubfieldsOptimizedForSize()
{
TestOptionalOptimizedForSize message = TestOptionalOptimizedForSize.DefaultInstance;
@@ -448,7 +448,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(message.IsInitialized);
}
- [Test]
+ [TestMethod]
public void OptimizedForSizeMergeUsesAllFieldsFromTarget()
{
TestOptimizedForSize withFieldSet = new TestOptimizedForSize.Builder {I = 10}.Build();
@@ -458,7 +458,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(10, built.I);
}
- [Test]
+ [TestMethod]
public void UninitializedExtensionInOptimizedForSizeMakesMessageUninitialized()
{
TestOptimizedForSize.Builder builder = new TestOptimizedForSize.Builder();
@@ -474,7 +474,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(builder.BuildPartial().IsInitialized);
}
- [Test]
+ [TestMethod]
public void ToBuilder()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -483,7 +483,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllFieldsSet(message.ToBuilder().Build());
}
- [Test]
+ [TestMethod]
public void FieldConstantValues()
{
Assert.AreEqual(TestAllTypes.Types.NestedMessage.BbFieldNumber, 1);
@@ -497,7 +497,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(TestAllTypes.RepeatedNestedEnumFieldNumber, 51);
}
- [Test]
+ [TestMethod]
public void ExtensionConstantValues()
{
Assert.AreEqual(TestRequired.SingleFieldNumber, 1000);
@@ -512,7 +512,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(UnitTestProtoFile.RepeatedNestedEnumExtensionFieldNumber, 51);
}
- [Test]
+ [TestMethod]
public void EmptyPackedValue()
{
TestPackedTypes empty = new TestPackedTypes.Builder().Build();
diff --git a/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs b/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs
index 3e4eafe7..78f059f7 100644
--- a/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs
+++ b/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs
@@ -37,15 +37,15 @@
using System.Collections.Generic;
using System.IO;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using NestedMessage = Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class MessageStreamIteratorTest
{
- [Test]
+ [TestMethod]
public void ThreeMessagesInMemory()
{
MemoryStream stream = new MemoryStream(MessageStreamWriterTest.ThreeMessageData);
@@ -58,7 +58,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(messages[2].HasBb);
}
- [Test]
+ [TestMethod]
public void ManyMessagesShouldNotTriggerSizeAlert()
{
int messageSize = TestUtil.GetAllSet().SerializedSize;
diff --git a/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs b/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs
index e2737914..53772523 100644
--- a/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs
+++ b/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs
@@ -35,12 +35,12 @@
#endregion
using System.IO;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using NestedMessage = Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class MessageStreamWriterTest
{
internal static readonly byte[] ThreeMessageData = new byte[]
@@ -55,7 +55,7 @@ namespace Google.ProtocolBuffers
(1 << 3) | 2, 0, // Field 1, no data (third message)
};
- [Test]
+ [TestMethod]
public void ThreeMessages()
{
NestedMessage message1 = new NestedMessage.Builder {Bb = 5}.Build();
diff --git a/src/ProtocolBuffers.Test/MessageTest.cs b/src/ProtocolBuffers.Test/MessageTest.cs
index 0f2d1c9a..f27865b0 100644
--- a/src/ProtocolBuffers.Test/MessageTest.cs
+++ b/src/ProtocolBuffers.Test/MessageTest.cs
@@ -37,7 +37,7 @@
using System.IO;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
@@ -45,7 +45,7 @@ namespace Google.ProtocolBuffers
/// Miscellaneous tests for message operations that apply to both
/// generated and dynamic messages.
/// </summary>
- [TestFixture]
+ [TestClass]
public class MessageTest
{
// =================================================================
@@ -77,7 +77,7 @@ namespace Google.ProtocolBuffers
"repeated_string: \"qux\"\n" +
"repeated_string: \"bar\"\n";
- [Test]
+ [TestMethod]
public void MergeFrom()
{
TestAllTypes result = TestAllTypes.CreateBuilder(MergeDest).MergeFrom(MergeSource).Build();
@@ -90,7 +90,7 @@ namespace Google.ProtocolBuffers
/// As long as they have the same descriptor, this should work, but it is an
/// entirely different code path.
/// </summary>
- [Test]
+ [TestMethod]
public void MergeFromDynamic()
{
TestAllTypes result = (TestAllTypes) TestAllTypes.CreateBuilder(MergeDest)
@@ -103,7 +103,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Test merging two DynamicMessages.
/// </summary>
- [Test]
+ [TestMethod]
public void DynamicMergeFrom()
{
DynamicMessage result = (DynamicMessage) DynamicMessage.CreateBuilder(MergeDest)
@@ -127,7 +127,7 @@ namespace Google.ProtocolBuffers
C = 3
}.Build();
- [Test]
+ [TestMethod]
public void Initialization()
{
TestRequired.Builder builder = TestRequired.CreateBuilder();
@@ -141,7 +141,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(builder.IsInitialized);
}
- [Test]
+ [TestMethod]
public void RequiredForeign()
{
TestRequiredForeign.Builder builder = TestRequiredForeign.CreateBuilder();
@@ -161,7 +161,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(builder.IsInitialized);
}
- [Test]
+ [TestMethod]
public void RequiredExtension()
{
TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
@@ -181,7 +181,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(builder.IsInitialized);
}
- [Test]
+ [TestMethod]
public void RequiredDynamic()
{
MessageDescriptor descriptor = TestRequired.Descriptor;
@@ -196,7 +196,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(builder.IsInitialized);
}
- [Test]
+ [TestMethod]
public void RequiredDynamicForeign()
{
MessageDescriptor descriptor = TestRequiredForeign.Descriptor;
@@ -219,7 +219,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(builder.IsInitialized);
}
- [Test]
+ [TestMethod]
public void UninitializedException()
{
try
@@ -233,7 +233,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void BuildPartial()
{
// We're mostly testing that no exception is thrown.
@@ -241,7 +241,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(message.IsInitialized);
}
- [Test]
+ [TestMethod]
public void NestedUninitializedException()
{
try
@@ -270,7 +270,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void BuildNestedPartial()
{
// We're mostly testing that no exception is thrown.
@@ -283,7 +283,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(message.IsInitialized);
}
- [Test]
+ [TestMethod]
public void ParseUnititialized()
{
try
@@ -297,7 +297,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void ParseNestedUnititialized()
{
ByteString data =
@@ -329,7 +329,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void DynamicUninitializedException()
{
try
@@ -343,7 +343,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void DynamicBuildPartial()
{
// We're mostly testing that no exception is thrown.
@@ -351,7 +351,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(message.Initialized);
}
- [Test]
+ [TestMethod]
public void DynamicParseUnititialized()
{
try
@@ -366,7 +366,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void PackedTypesWrittenDirectlyToStream()
{
TestPackedTypes message = new TestPackedTypes.Builder {PackedInt32List = {0, 1, 2}}.Build();
diff --git a/src/ProtocolBuffers.Test/MessageUtilTest.cs b/src/ProtocolBuffers.Test/MessageUtilTest.cs
index c7e08fe8..9c360517 100644
--- a/src/ProtocolBuffers.Test/MessageUtilTest.cs
+++ b/src/ProtocolBuffers.Test/MessageUtilTest.cs
@@ -36,49 +36,49 @@
using System;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class MessageUtilTest
{
- [Test]
+ [TestMethod]
[ExpectedException(typeof (ArgumentNullException))]
public void NullTypeName()
{
MessageUtil.GetDefaultMessage((string) null);
}
- [Test]
+ [TestMethod]
[ExpectedException(typeof (ArgumentException))]
public void InvalidTypeName()
{
MessageUtil.GetDefaultMessage("invalidtypename");
}
- [Test]
+ [TestMethod]
public void ValidTypeName()
{
Assert.AreSame(TestAllTypes.DefaultInstance,
MessageUtil.GetDefaultMessage(typeof (TestAllTypes).AssemblyQualifiedName));
}
- [Test]
+ [TestMethod]
[ExpectedException(typeof (ArgumentNullException))]
public void NullType()
{
MessageUtil.GetDefaultMessage((Type) null);
}
- [Test]
+ [TestMethod]
[ExpectedException(typeof (ArgumentException))]
public void NonMessageType()
{
MessageUtil.GetDefaultMessage(typeof (string));
}
- [Test]
+ [TestMethod]
public void ValidType()
{
Assert.AreSame(TestAllTypes.DefaultInstance, MessageUtil.GetDefaultMessage(typeof (TestAllTypes)));
diff --git a/src/ProtocolBuffers.Test/NameHelpersTest.cs b/src/ProtocolBuffers.Test/NameHelpersTest.cs
index a33de672..50ab373d 100644
--- a/src/ProtocolBuffers.Test/NameHelpersTest.cs
+++ b/src/ProtocolBuffers.Test/NameHelpersTest.cs
@@ -34,14 +34,14 @@
#endregion
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class NameHelpersTest
{
- [Test]
+ [TestMethod]
public void UnderscoresToPascalCase()
{
Assert.AreEqual("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_bar"));
@@ -55,7 +55,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("_1Bar", NameHelpers.UnderscoresToPascalCase("_1_bar"));
}
- [Test]
+ [TestMethod]
public void UnderscoresToCamelCase()
{
Assert.AreEqual("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_bar"));
@@ -69,7 +69,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("_1Bar", NameHelpers.UnderscoresToCamelCase("_1_bar"));
}
- [Test]
+ [TestMethod]
public void StripSuffix()
{
string text = "FooBar";
diff --git a/src/ProtocolBuffers.Test/Properties/AppManifest.xml b/src/ProtocolBuffers.Test/Properties/AppManifest.xml
new file mode 100644
index 00000000..a9552327
--- /dev/null
+++ b/src/ProtocolBuffers.Test/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test(Silverlight).csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test(Silverlight).csproj
new file mode 100644
index 00000000..4ff2e676
--- /dev/null
+++ b/src/ProtocolBuffers.Test/ProtocolBuffers.Test(Silverlight).csproj
@@ -0,0 +1,184 @@
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug_Silverlight</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers</RootNamespace>
+ <AssemblyName>Google.ProtocolBuffers.Test</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>Google.ProtocolBuffers.Test.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>Google.ProtocolBuffers.App</SilverlightAppEntry>
+ <TestPageFileName>TestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>false</ValidateXaml>
+ <ThrowErrorsInValidation>false</ThrowErrorsInValidation>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug_Silverlight</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>3021</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release_Silverlight</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>3021</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Silverlight.Testing, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Windows" />
+ <Reference Include="mscorlib" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AbstractMessageTest.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="ByteStringTest.cs" />
+ <Compile Include="CodedInputStreamTest.cs" />
+ <Compile Include="CodedOutputStreamTest.cs" />
+ <Compile Include="Collections\PopsicleListTest.cs" />
+ <Compile Include="Compatibility\BinaryCompatibilityTests.cs" />
+ <Compile Include="Compatibility\CompatibilityTests.cs" />
+ <Compile Include="Compatibility\DictionaryCompatibilityTests.cs" />
+ <Compile Include="Compatibility\JsonCompatibilityTests.cs" />
+ <Compile Include="Compatibility\TestResources.cs" />
+ <Compile Include="Compatibility\TextCompatibilityTests.cs" />
+ <Compile Include="Compatibility\XmlCompatibilityTests.cs" />
+ <Compile Include="CSharpOptionsTest.cs" />
+ <Compile Include="DeprecatedMemberTest.cs" />
+ <Compile Include="DescriptorsTest.cs" />
+ <Compile Include="Descriptors\MessageDescriptorTest.cs" />
+ <Compile Include="DynamicMessageTest.cs" />
+ <Compile Include="ExtendableMessageTest.cs" />
+ <Compile Include="GeneratedBuilderTest.cs" />
+ <Compile Include="GeneratedMessageTest.cs" />
+ <Compile Include="MessageStreamIteratorTest.cs" />
+ <Compile Include="MessageStreamWriterTest.cs" />
+ <Compile Include="MessageTest.cs" />
+ <Compile Include="MessageUtilTest.cs" />
+ <Compile Include="NameHelpersTest.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="ReflectionTester.cs" />
+ <Compile Include="ReusableBuilderTest.cs" />
+ <Compile Include="SerializableAttribute.cs" />
+ <Compile Include="TestCornerCases.cs" />
+ <Compile Include="TestMimeMessageFormats.cs" />
+ <Compile Include="TestProtos\UnitTestCSharpOptionsProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestCustomOptionsProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestEmbedOptimizeForProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestEmptyProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestExtrasIssuesProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestExtrasProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestGenericServices.cs" />
+ <Compile Include="TestProtos\UnitTestGoogleSizeProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestGoogleSpeedProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestImportLiteProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestImportProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestMessageSetProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestNoGenericServicesProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestOptimizeForProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestRpcInterop.cs" />
+ <Compile Include="TestProtos\UnitTestXmlSerializerTestProtoFile.cs" />
+ <Compile Include="TestReaderForUrlEncoded.cs" />
+ <Compile Include="TestRpcForMimeTypes.cs" />
+ <Compile Include="TestRpcGenerator.cs" />
+ <Compile Include="TestUtil.cs" />
+ <Compile Include="TestWriterFormatJson.cs" />
+ <Compile Include="TestWriterFormatXml.cs" />
+ <Compile Include="UnknownFieldSetTest.cs" />
+ <Compile Include="WireFormatTest.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Compatibility\google_message1.dat" />
+ <EmbeddedResource Include="Compatibility\google_message2.dat" />
+ <None Include="Properties\AppManifest.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers.Serialization\ProtocolBuffers.Serialization%28Silverlight%29.csproj">
+ <Project>{72B69A15-E28E-4738-A779-18D76C87D225}</Project>
+ <Name>ProtocolBuffers.Serialization%28Silverlight%29</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers%28Silverlight%29.csproj">
+ <Project>{7E4E681E-5D09-43FB-8D9E-35A454730A85}</Project>
+ <Name>ProtocolBuffers%28Silverlight%29</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
index 8000e7d2..24547a47 100644
--- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
+++ b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
@@ -58,9 +58,9 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
+ <Reference Include="nunit.framework">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\NUnit 2.2.8.0\nunit.framework.dll</HintPath>
+ <HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=3.5.0.2, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -72,6 +72,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="..\..\lib\NUnit-config\Microsoft.VisualStudio.TestTools.cs">
+ <Link>Microsoft.VisualStudio.TestTools.cs</Link>
+ </Compile>
<Compile Include="AbstractMessageTest.cs" />
<Compile Include="ByteStringTest.cs" />
<Compile Include="CodedInputStreamTest.cs" />
@@ -162,8 +165,7 @@
<EmbeddedResource Include="Compatibility\google_message1.dat" />
<EmbeddedResource Include="Compatibility\google_message2.dat" />
</ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Debug' " />
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Release' " />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
@@ -171,4 +173,10 @@
<Target Name="AfterBuild">
</Target>
-->
+ <PropertyGroup>
+ <StartAction>Program</StartAction>
+ <StartProgram>$(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe</StartProgram>
+ <StartArguments>/nologo /noshadow /labels /wait $(AssemblyName).dll</StartArguments>
+ <StartWorkingDirectory>$(ProjectDir)$(OutputPath)</StartWorkingDirectory>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffers.Test/ReflectionTester.cs b/src/ProtocolBuffers.Test/ReflectionTester.cs
index 5f323228..9565a167 100644
--- a/src/ProtocolBuffers.Test/ReflectionTester.cs
+++ b/src/ProtocolBuffers.Test/ReflectionTester.cs
@@ -37,7 +37,9 @@
using System;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+#pragma warning disable 618 // Disable warning about obsolete use miss-matched assert arguments
namespace Google.ProtocolBuffers
{
@@ -472,7 +474,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(101, message[f("optional_int32")]);
Assert.AreEqual(102L, message[f("optional_int64")]);
- Assert.AreEqual(103U, message[f("optional_uint32")]);
+ Assert.AreEqual(103u, message[f("optional_uint32")]);
Assert.AreEqual(104UL, message[f("optional_uint64")]);
Assert.AreEqual(105, message[f("optional_sint32")]);
Assert.AreEqual(106L, message[f("optional_sint64")]);
@@ -957,28 +959,30 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_double")));
Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_bool")));
Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_enum")));
+
Assert.AreEqual(601, message[f("packed_int32"), 0]);
Assert.AreEqual(602L, message[f("packed_int64"), 0]);
- Assert.AreEqual(603, message[f("packed_uint32"), 0]);
- Assert.AreEqual(604L, message[f("packed_uint64"), 0]);
+ Assert.AreEqual(603u, message[f("packed_uint32"), 0]);
+ Assert.AreEqual(604uL, message[f("packed_uint64"), 0]);
Assert.AreEqual(605, message[f("packed_sint32"), 0]);
Assert.AreEqual(606L, message[f("packed_sint64"), 0]);
- Assert.AreEqual(607, message[f("packed_fixed32"), 0]);
- Assert.AreEqual(608L, message[f("packed_fixed64"), 0]);
+ Assert.AreEqual(607u, message[f("packed_fixed32"), 0]);
+ Assert.AreEqual(608uL, message[f("packed_fixed64"), 0]);
Assert.AreEqual(609, message[f("packed_sfixed32"), 0]);
Assert.AreEqual(610L, message[f("packed_sfixed64"), 0]);
Assert.AreEqual(611F, message[f("packed_float"), 0]);
Assert.AreEqual(612D, message[f("packed_double"), 0]);
Assert.AreEqual(true, message[f("packed_bool"), 0]);
Assert.AreEqual(foreignBar, message[f("packed_enum"), 0]);
+
Assert.AreEqual(701, message[f("packed_int32"), 1]);
Assert.AreEqual(702L, message[f("packed_int64"), 1]);
- Assert.AreEqual(703, message[f("packed_uint32"), 1]);
- Assert.AreEqual(704L, message[f("packed_uint64"), 1]);
+ Assert.AreEqual(703u, message[f("packed_uint32"), 1]);
+ Assert.AreEqual(704uL, message[f("packed_uint64"), 1]);
Assert.AreEqual(705, message[f("packed_sint32"), 1]);
Assert.AreEqual(706L, message[f("packed_sint64"), 1]);
- Assert.AreEqual(707, message[f("packed_fixed32"), 1]);
- Assert.AreEqual(708L, message[f("packed_fixed64"), 1]);
+ Assert.AreEqual(707u, message[f("packed_fixed32"), 1]);
+ Assert.AreEqual(708uL, message[f("packed_fixed64"), 1]);
Assert.AreEqual(709, message[f("packed_sfixed32"), 1]);
Assert.AreEqual(710L, message[f("packed_sfixed64"), 1]);
Assert.AreEqual(711F, message[f("packed_float"), 1]);
diff --git a/src/ProtocolBuffers.Test/ReusableBuilderTest.cs b/src/ProtocolBuffers.Test/ReusableBuilderTest.cs
index d5755f6f..93129b2f 100644
--- a/src/ProtocolBuffers.Test/ReusableBuilderTest.cs
+++ b/src/ProtocolBuffers.Test/ReusableBuilderTest.cs
@@ -3,17 +3,17 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using Google.ProtocolBuffers.Collections;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using Google.ProtocolBuffers.TestProtos;
using Google.ProtocolBuffers.Serialization;
using UnitTest.Issues.TestProtos;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class ReusableBuilderTest
{
- [Test, Description("Issue 28: Circular message dependencies result in null defaults for DefaultInstance")]
+ [TestMethod, System.ComponentModel.Description("Issue 28: Circular message dependencies result in null defaults for DefaultInstance")]
public void EnsureStaticCicularReference()
{
MyMessageAReferenceB ab = MyMessageAReferenceB.DefaultInstance;
@@ -24,7 +24,7 @@ namespace Google.ProtocolBuffers
Assert.IsNotNull(ba.Value);
}
- [Test]
+ [TestMethod]
public void TestModifyDefaultInstance()
{
//verify that the default instance has correctly been marked as read-only
@@ -33,7 +33,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(list.IsReadOnly);
}
- [Test]
+ [TestMethod]
public void TestUnmodifiedDefaultInstance()
{
//Simply calling ToBuilder().Build() no longer creates a copy of the message
@@ -41,7 +41,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build()));
}
- [Test]
+ [TestMethod]
public void BuildMultipleWithoutChange()
{
//Calling Build() or BuildPartial() does not require a copy of the message
@@ -55,7 +55,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(ReferenceEquals(first, builder.BuildPartial().ToBuilder().Build()));
}
- [Test]
+ [TestMethod]
public void MergeFromDefaultInstance()
{
TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder();
@@ -64,7 +64,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build()));
}
- [Test]
+ [TestMethod]
public void BuildNewBuilderIsDefaultInstance()
{
Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, new TestAllTypes.Builder().Build()));
@@ -74,7 +74,7 @@ namespace Google.ProtocolBuffers
TestAllTypes.CreateBuilder().SetOptionalBool(true).Build().ToBuilder().Clear().Build()));
}
- [Test]
+ [TestMethod]
public void BuildModifyAndRebuild()
{
TestAllTypes.Builder b1 = new TestAllTypes.Builder();
@@ -94,7 +94,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("{\"optional_foreign_message\":{\"c\":7},\"repeated_int32\":[2,6],\"default_int32\":5}", Extensions.ToJson(m2));
}
- [Test]
+ [TestMethod]
public void CloneOnChangePrimitive()
{
TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder();
@@ -103,7 +103,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build()));
}
- [Test]
+ [TestMethod]
public void CloneOnAddRepeatedBool()
{
TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder();
@@ -112,7 +112,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build()));
}
- [Test]
+ [TestMethod]
public void CloneOnGetRepeatedBoolList()
{
TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder();
@@ -121,7 +121,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build()));
}
- [Test]
+ [TestMethod]
public void CloneOnChangeMessage()
{
TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder();
@@ -130,7 +130,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build()));
}
- [Test]
+ [TestMethod]
public void CloneOnClearMessage()
{
TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder();
@@ -139,7 +139,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build()));
}
- [Test]
+ [TestMethod]
public void CloneOnGetRepeatedForeignMessageList()
{
TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder();
@@ -148,7 +148,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build()));
}
- [Test]
+ [TestMethod]
public void CloneOnChangeEnumValue()
{
TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder();
@@ -157,7 +157,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build()));
}
- [Test]
+ [TestMethod]
public void CloneOnGetRepeatedForeignEnumList()
{
TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder();
diff --git a/src/ProtocolBuffers.Test/SerializableAttribute.cs b/src/ProtocolBuffers.Test/SerializableAttribute.cs
new file mode 100644
index 00000000..04fcdcba
--- /dev/null
+++ b/src/ProtocolBuffers.Test/SerializableAttribute.cs
@@ -0,0 +1,12 @@
+#if SILVERLIGHT
+
+namespace System
+{
+ [AttributeUsage(AttributeTargets.Class)]
+ public class SerializableAttribute : Attribute
+ {
+ public SerializableAttribute () : base() { }
+ }
+}
+
+#endif
diff --git a/src/ProtocolBuffers.Test/SerializableTest.cs b/src/ProtocolBuffers.Test/SerializableTest.cs
index f1073c1e..edf6ce49 100644
--- a/src/ProtocolBuffers.Test/SerializableTest.cs
+++ b/src/ProtocolBuffers.Test/SerializableTest.cs
@@ -5,11 +5,11 @@ using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class SerializableTest
{
/// <summary>
@@ -18,7 +18,7 @@ namespace Google.ProtocolBuffers
public static readonly ISerializable CompileTimeCheckSerializableMessage = TestXmlMessage.DefaultInstance;
public static readonly ISerializable CompileTimeCheckSerializableBuilder = new TestXmlMessage.Builder();
- [Test]
+ [TestMethod]
public void TestPlainMessage()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -51,7 +51,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestMessageWithExtensions()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -96,7 +96,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestPlainBuilder()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder()
@@ -129,7 +129,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(builder.Build(), copy.Build());
}
- [Test]
+ [TestMethod]
public void TestBuilderWithExtensions()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder()
diff --git a/src/ProtocolBuffers.Test/ServiceTest.cs b/src/ProtocolBuffers.Test/ServiceTest.cs
index dbfa10c9..4678ca7b 100644
--- a/src/ProtocolBuffers.Test/ServiceTest.cs
+++ b/src/ProtocolBuffers.Test/ServiceTest.cs
@@ -37,9 +37,10 @@
using System;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using Rhino.Mocks;
using Rhino.Mocks.Constraints;
+using Is = Rhino.Mocks.Constraints.Is;
namespace Google.ProtocolBuffers
{
@@ -47,7 +48,7 @@ namespace Google.ProtocolBuffers
/// Tests for generated service classes.
/// TODO(jonskeet): Convert the mocking tests using Rhino.Mocks.
/// </summary>
- [TestFixture]
+ [TestClass]
public class ServiceTest
{
private delegate void Action<T1, T2>(T1 t1, T2 t2);
@@ -55,7 +56,7 @@ namespace Google.ProtocolBuffers
private static readonly MethodDescriptor FooDescriptor = TestGenericService.Descriptor.Methods[0];
private static readonly MethodDescriptor BarDescriptor = TestGenericService.Descriptor.Methods[1];
- [Test]
+ [TestMethod]
public void GetRequestPrototype()
{
TestGenericService service = new TestServiceImpl();
@@ -64,7 +65,7 @@ namespace Google.ProtocolBuffers
Assert.AreSame(service.GetRequestPrototype(BarDescriptor), BarRequest.DefaultInstance);
}
- [Test]
+ [TestMethod]
public void GetResponsePrototype()
{
TestGenericService service = new TestServiceImpl();
@@ -73,7 +74,7 @@ namespace Google.ProtocolBuffers
Assert.AreSame(service.GetResponsePrototype(BarDescriptor), BarResponse.DefaultInstance);
}
- [Test]
+ [TestMethod]
public void CallMethodFoo()
{
MockRepository mocks = new MockRepository();
@@ -117,8 +118,8 @@ namespace Google.ProtocolBuffers
/// that the choice between Foo and Bar is arbitrary, hence the lack of a corresponding Bar
/// test.
/// </summary>
- [Test]
- [Ignore("Crashes Mono - needs further investigation")]
+ [TestMethod]
+ [Ignore, System.ComponentModel.Description("Crashes Mono - needs further investigation")]
public void GeneratedStubFooCall()
{
FooRequest fooRequest = FooRequest.CreateBuilder().Build();
@@ -144,7 +145,7 @@ namespace Google.ProtocolBuffers
mocks.VerifyAll();
}
- [Test]
+ [TestMethod]
public void CallMethodBar()
{
MockRepository mocks = new MockRepository();
diff --git a/src/ProtocolBuffers.Test/TestCornerCases.cs b/src/ProtocolBuffers.Test/TestCornerCases.cs
index 8a3fe051..0be4e1d4 100644
--- a/src/ProtocolBuffers.Test/TestCornerCases.cs
+++ b/src/ProtocolBuffers.Test/TestCornerCases.cs
@@ -1,15 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using UnitTest.Issues.TestProtos;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class TestCornerCases
{
- [Test]
+ [TestMethod]
public void TestRoundTripNegativeEnums()
{
NegativeEnumMessage msg = NegativeEnumMessage.CreateBuilder()
diff --git a/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs b/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs
index 619f4357..c16f567f 100644
--- a/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs
+++ b/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs
@@ -5,11 +5,11 @@ using System.Text;
using Google.ProtocolBuffers.Serialization;
using Google.ProtocolBuffers.Serialization.Http;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class TestMimeMessageFormats
{
// There is a whole host of various json mime types in use around the net, this is the set we accept...
@@ -17,7 +17,7 @@ namespace Google.ProtocolBuffers
readonly IEnumerable<string> XmlTypes = new string[] { "text/xml", "application/xml" };
readonly IEnumerable<string> ProtobufTypes = new string[] { "application/binary", "application/x-protobuf", "application/vnd.google.protobuf" };
- [Test]
+ [TestMethod]
public void TestReadJsonMimeTypes()
{
foreach (string type in JsonTypes)
@@ -30,7 +30,7 @@ namespace Google.ProtocolBuffers
MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/json" }, null, Stream.Null)
is JsonFormatReader);
}
- [Test]
+ [TestMethod]
public void TestWriteJsonMimeTypes()
{
foreach (string type in JsonTypes)
@@ -43,7 +43,7 @@ namespace Google.ProtocolBuffers
MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/json" }, null, Stream.Null)
is JsonFormatWriter);
}
- [Test]
+ [TestMethod]
public void TestReadXmlMimeTypes()
{
foreach (string type in XmlTypes)
@@ -56,7 +56,7 @@ namespace Google.ProtocolBuffers
MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/xml" }, null, Stream.Null)
is XmlFormatReader);
}
- [Test]
+ [TestMethod]
public void TestWriteXmlMimeTypes()
{
foreach (string type in XmlTypes)
@@ -69,7 +69,7 @@ namespace Google.ProtocolBuffers
MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/xml" }, null, Stream.Null)
is XmlFormatWriter);
}
- [Test]
+ [TestMethod]
public void TestReadProtoMimeTypes()
{
foreach (string type in ProtobufTypes)
@@ -82,7 +82,7 @@ namespace Google.ProtocolBuffers
MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null)
is CodedInputStream);
}
- [Test]
+ [TestMethod]
public void TestWriteProtoMimeTypes()
{
foreach (string type in ProtobufTypes)
@@ -95,29 +95,29 @@ namespace Google.ProtocolBuffers
MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null)
is CodedOutputStream);
}
- [Test]
+ [TestMethod]
public void TestMergeFromJsonType()
{
TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(),
- new MessageFormatOptions(), "application/json", new MemoryStream(Encoding.ASCII.GetBytes(
+ new MessageFormatOptions(), "application/json", new MemoryStream(Encoding.UTF8.GetBytes(
Extensions.ToJson(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build())
)))
.Build();
Assert.AreEqual("a", msg.Text);
Assert.AreEqual(1, msg.Number);
}
- [Test]
+ [TestMethod]
public void TestMergeFromXmlType()
{
TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(),
- new MessageFormatOptions(), "application/xml", new MemoryStream(Encoding.ASCII.GetBytes(
+ new MessageFormatOptions(), "application/xml", new MemoryStream(Encoding.UTF8.GetBytes(
Extensions.ToXml(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build())
)))
.Build();
Assert.AreEqual("a", msg.Text);
Assert.AreEqual(1, msg.Number);
}
- [Test]
+ [TestMethod]
public void TestMergeFromProtoType()
{
TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(),
@@ -128,25 +128,25 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("a", msg.Text);
Assert.AreEqual(1, msg.Number);
}
- [Test]
+ [TestMethod]
public void TestWriteToJsonType()
{
MemoryStream ms = new MemoryStream();
Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(),
new MessageFormatOptions(), "application/json", ms);
- Assert.AreEqual(@"{""text"":""a"",""number"":1}", Encoding.UTF8.GetString(ms.ToArray()));
+ Assert.AreEqual(@"{""text"":""a"",""number"":1}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length));
}
- [Test]
+ [TestMethod]
public void TestWriteToXmlType()
{
MemoryStream ms = new MemoryStream();
Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(),
new MessageFormatOptions(), "application/xml", ms);
- Assert.AreEqual("<root><text>a</text><number>1</number></root>", Encoding.UTF8.GetString(ms.ToArray()));
+ Assert.AreEqual("<root><text>a</text><number>1</number></root>", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length));
}
- [Test]
+ [TestMethod]
public void TestWriteToProtoType()
{
MemoryStream ms = new MemoryStream();
@@ -154,9 +154,9 @@ namespace Google.ProtocolBuffers
new MessageFormatOptions(), "application/vnd.google.protobuf", ms);
byte[] bytes = TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build().ToByteArray();
- Assert.AreEqual(bytes, ms.ToArray());
+ TestUtil.AssertBytesEqual(bytes, ms.ToArray());
}
- [Test]
+ [TestMethod]
public void TestXmlReaderOptions()
{
MemoryStream ms = new MemoryStream();
@@ -180,7 +180,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(2, msg.NumbersList[1]);
}
- [Test]
+ [TestMethod]
public void TestXmlWriterOptions()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder().SetText("a").AddNumbers(1).AddNumbers(2).Build();
@@ -203,26 +203,26 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(1, builder.NumbersList[0]);
Assert.AreEqual(2, builder.NumbersList[1]);
}
- [Test]
+ [TestMethod]
public void TestJsonFormatted()
{
MemoryStream ms = new MemoryStream();
Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(),
new MessageFormatOptions() { FormattedOutput = true }, "application/json", ms);
- Assert.AreEqual("{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray()));
+ Assert.AreEqual("{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length));
}
- [Test]
+ [TestMethod]
public void TestXmlFormatted()
{
MemoryStream ms = new MemoryStream();
Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(),
new MessageFormatOptions() { FormattedOutput = true }, "application/xml", ms);
- Assert.AreEqual("<root>\r\n <text>a</text>\r\n <number>1</number>\r\n</root>", Encoding.UTF8.GetString(ms.ToArray()));
+ Assert.AreEqual("<root>\r\n <text>a</text>\r\n <number>1</number>\r\n</root>", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length));
}
- [Test]
+ [TestMethod]
public void TestReadCustomMimeTypes()
{
var options = new MessageFormatOptions();
@@ -232,7 +232,7 @@ namespace Google.ProtocolBuffers
options.MimeInputTypes.Add("-custom-XML-mime-type-", XmlFormatReader.CreateInstance);
Assert.AreEqual(1, options.MimeInputTypes.Count);
- Stream xmlStream = new MemoryStream(Encoding.ASCII.GetBytes(
+ Stream xmlStream = new MemoryStream(Encoding.UTF8.GetBytes(
Extensions.ToXml(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build())
));
@@ -243,7 +243,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(1, msg.Number);
}
- [Test]
+ [TestMethod]
public void TestWriteToCustomType()
{
var options = new MessageFormatOptions();
@@ -258,7 +258,7 @@ namespace Google.ProtocolBuffers
Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(),
options, "-custom-XML-mime-type-", ms);
- Assert.AreEqual("<root><text>a</text><number>1</number></root>", Encoding.UTF8.GetString(ms.ToArray()));
+ Assert.AreEqual("<root><text>a</text><number>1</number></root>", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length));
}
}
} \ No newline at end of file
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
index ce8f66d9..b9d9b0be 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
@@ -1391,7 +1391,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public SearchService(pb::IRpcDispatch dispatch) : this(dispatch, true) {
}
public SearchService(pb::IRpcDispatch dispatch, bool dispose) {
- if (null == (this.dispatch = dispatch)) throw new global::System.ArgumentNullException();
+ pb::ThrowHelper.ThrowIfNull(this.dispatch = dispatch, "dispatch");
this.dispose = dispose && dispatch is global::System.IDisposable;
}
@@ -1421,7 +1421,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public Dispatch(ISearchService implementation) : this(implementation, true) {
}
public Dispatch(ISearchService implementation, bool dispose) {
- if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException();
+ pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation");
this.dispose = dispose && implementation is global::System.IDisposable;
}
@@ -1435,7 +1435,7 @@ namespace Google.ProtocolBuffers.TestProtos {
switch(methodName) {
case "Search": return response.MergeFrom(implementation.Search((global::Google.ProtocolBuffers.TestProtos.SearchRequest)request)).Build();
case "RefineSearch": return response.MergeFrom(implementation.RefineSearch((global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest)request)).Build();
- default: throw new global::System.MissingMethodException(typeof(ISearchService).FullName, methodName);
+ default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName);
}
}
}
@@ -1453,7 +1453,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public ServerStub(pb::IRpcDispatch implementation) : this(implementation, true) {
}
public ServerStub(pb::IRpcDispatch implementation, bool dispose) {
- if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException();
+ pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation");
this.dispose = dispose && implementation is global::System.IDisposable;
}
@@ -1465,7 +1465,7 @@ namespace Google.ProtocolBuffers.TestProtos {
switch(methodName) {
case "Search": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.SearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder());
case "RefineSearch": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder());
- default: throw new global::System.MissingMethodException(typeof(ISearchService).FullName, methodName);
+ default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName);
}
}
}
diff --git a/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs b/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs
index 7861e986..1c43e24d 100644
--- a/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs
+++ b/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs
@@ -1,16 +1,16 @@
using System;
using System.IO;
using System.Text;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using Google.ProtocolBuffers.TestProtos;
using Google.ProtocolBuffers.Serialization.Http;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class TestReaderForUrlEncoded
{
- [Test]
+ [TestMethod]
public void Example_FromQueryString()
{
Uri sampleUri = new Uri("http://sample.com/Path/File.ext?text=two+three%20four&valid=true&numbers=1&numbers=2", UriKind.Absolute);
@@ -28,7 +28,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(2, message.NumbersList[1]);
}
- [Test]
+ [TestMethod]
public void Example_FromFormData()
{
Stream rawPost = new MemoryStream(Encoding.UTF8.GetBytes("text=two+three%20four&valid=true&numbers=1&numbers=2"), false);
@@ -46,7 +46,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(2, message.NumbersList[1]);
}
- [Test]
+ [TestMethod]
public void TestEmptyValues()
{
ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text=&numbers=1");
@@ -60,7 +60,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(1, builder.NumbersList[0]);
}
- [Test]
+ [TestMethod]
public void TestNoValue()
{
ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text&numbers=1");
@@ -74,7 +74,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(1, builder.NumbersList[0]);
}
- [Test, ExpectedException(typeof(NotSupportedException))]
+ [TestMethod, ExpectedException(typeof(NotSupportedException))]
public void FormUrlEncodedReaderDoesNotSupportChildren()
{
ICodedInputStream input = FormUrlEncodedReader.CreateInstance("child=uh0");
diff --git a/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs b/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs
index 6575e0fd..68cb93da 100644
--- a/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs
+++ b/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs
@@ -38,7 +38,7 @@ using System;
using Google.ProtocolBuffers;
using Google.ProtocolBuffers.Serialization.Http;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using Google.ProtocolBuffers.Serialization;
using System.Text;
@@ -49,7 +49,7 @@ namespace Google.ProtocolBuffers
/// This class verifies the correct code is generated from unittest_rpc_interop.proto and provides a small demonstration
/// of using the new IRpcDispatch to write a client/server
/// </summary>
- [TestFixture]
+ [TestClass]
public class TestRpcForMimeTypes
{
/// <summary>
@@ -181,7 +181,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
- [Test]
+ [TestMethod]
public void TestClientServerWithJsonFormat()
{
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl());
@@ -210,7 +210,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
- [Test]
+ [TestMethod]
public void TestClientServerWithXmlFormat()
{
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl());
@@ -239,7 +239,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
- [Test]
+ [TestMethod]
public void TestClientServerWithProtoFormat()
{
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl());
@@ -268,7 +268,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
- [Test]
+ [TestMethod]
public void TestClientServerWithCustomFormat()
{
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl());
@@ -308,7 +308,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
- [Test]
+ [TestMethod]
public void TestServerWithUriFormat()
{
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl());
@@ -336,7 +336,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
- [Test, ExpectedException(typeof(ArgumentOutOfRangeException))]
+ [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
public void TestInvalidMimeType()
{
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl());
@@ -357,7 +357,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Test sending and recieving messages via text/json
/// </summary>
- [Test]
+ [TestMethod]
public void TestDefaultMimeType()
{
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl());
diff --git a/src/ProtocolBuffers.Test/TestRpcGenerator.cs b/src/ProtocolBuffers.Test/TestRpcGenerator.cs
index 5f159b62..18532d69 100644
--- a/src/ProtocolBuffers.Test/TestRpcGenerator.cs
+++ b/src/ProtocolBuffers.Test/TestRpcGenerator.cs
@@ -37,7 +37,7 @@
using System;
using Google.ProtocolBuffers;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
@@ -45,7 +45,7 @@ namespace Google.ProtocolBuffers
/// This class verifies the correct code is generated from unittest_rpc_interop.proto and provides a small demonstration
/// of using the new IRpcDispatch to write a client/server
/// </summary>
- [TestFixture]
+ [TestClass]
public class TestRpcGenerator
{
/// <summary>
@@ -142,7 +142,7 @@ namespace Google.ProtocolBuffers
/// Put it all together to create one seamless client/server experience full of rich-type goodness ;)
/// All you need to do is send/recieve the method name and message bytes across the wire.
/// </summary>
- [Test]
+ [TestMethod]
public void TestClientServerDispatch()
{
ExampleServerHost server = new ExampleServerHost(new ExampleSearchImpl());
diff --git a/src/ProtocolBuffers.Test/TestUtil.cs b/src/ProtocolBuffers.Test/TestUtil.cs
index ae2c1164..dd1c981d 100644
--- a/src/ProtocolBuffers.Test/TestUtil.cs
+++ b/src/ProtocolBuffers.Test/TestUtil.cs
@@ -41,14 +41,21 @@ using System.IO;
using System.Text;
using System.Threading;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+#if SILVERLIGHT
+using TestClass = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute;
+using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute;
+using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
+#else
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+#endif
+
namespace Google.ProtocolBuffers
{
internal static class TestUtil
{
+#if !SILVERLIGHT
private static string testDataDirectory;
- private static ByteString goldenMessage = null;
internal static string TestDataDirectory
{
@@ -76,6 +83,8 @@ namespace Google.ProtocolBuffers
}
}
+ private static ByteString goldenMessage = null;
+
internal static ByteString GoldenMessage
{
get
@@ -88,6 +97,36 @@ namespace Google.ProtocolBuffers
}
}
+ internal static string ReadTextFromFile(string filePath)
+ {
+ return ReadBytesFromFile(filePath).ToStringUtf8();
+ }
+
+ internal static ByteString ReadBytesFromFile(String filename)
+ {
+ byte[] data = File.ReadAllBytes(Path.Combine(TestDataDirectory, filename));
+ return ByteString.CopyFrom(data);
+ }
+
+ private static ByteString goldenPackedFieldsMessage = null;
+
+ /// <summary>
+ /// Get the bytes of the "golden packed fields message". This is a serialized
+ /// TestPackedTypes with all fields set as they would be by SetPackedFields,
+ /// but it is loaded from a file on disk rather than generated dynamically.
+ /// The file is actually generated by C++ code, so testing against it verifies compatibility
+ /// with C++.
+ /// </summary>
+ public static ByteString GetGoldenPackedFieldsMessage()
+ {
+ if (goldenPackedFieldsMessage == null)
+ {
+ goldenPackedFieldsMessage = ReadBytesFromFile("golden_packed_fields_message");
+ }
+ return goldenPackedFieldsMessage;
+ }
+
+#endif
/// <summary>
/// Creates an unmodifiable ExtensionRegistry containing all the extensions
/// of TestAllExtensions.
@@ -193,17 +232,6 @@ namespace Google.ProtocolBuffers
registry.Add(UnitTestProtoFile.PackedEnumExtension);
}
- internal static string ReadTextFromFile(string filePath)
- {
- return ReadBytesFromFile(filePath).ToStringUtf8();
- }
-
- internal static ByteString ReadBytesFromFile(String filename)
- {
- byte[] data = File.ReadAllBytes(Path.Combine(TestDataDirectory, filename));
- return ByteString.CopyFrom(data);
- }
-
/// <summary>
/// Helper to convert a String to ByteString.
/// </summary>
@@ -379,12 +407,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(101, message.OptionalInt32);
Assert.AreEqual(102, message.OptionalInt64);
- Assert.AreEqual(103, message.OptionalUint32);
- Assert.AreEqual(104, message.OptionalUint64);
+ Assert.AreEqual(103u, message.OptionalUint32);
+ Assert.AreEqual(104u, message.OptionalUint64);
Assert.AreEqual(105, message.OptionalSint32);
Assert.AreEqual(106, message.OptionalSint64);
- Assert.AreEqual(107, message.OptionalFixed32);
- Assert.AreEqual(108, message.OptionalFixed64);
+ Assert.AreEqual(107u, message.OptionalFixed32);
+ Assert.AreEqual(108u, message.OptionalFixed64);
Assert.AreEqual(109, message.OptionalSfixed32);
Assert.AreEqual(110, message.OptionalSfixed64);
Assert.AreEqual(111, message.OptionalFloat);
@@ -436,12 +464,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(201, message.GetRepeatedInt32(0));
Assert.AreEqual(202, message.GetRepeatedInt64(0));
- Assert.AreEqual(203, message.GetRepeatedUint32(0));
- Assert.AreEqual(204, message.GetRepeatedUint64(0));
+ Assert.AreEqual(203u, message.GetRepeatedUint32(0));
+ Assert.AreEqual(204u, message.GetRepeatedUint64(0));
Assert.AreEqual(205, message.GetRepeatedSint32(0));
Assert.AreEqual(206, message.GetRepeatedSint64(0));
- Assert.AreEqual(207, message.GetRepeatedFixed32(0));
- Assert.AreEqual(208, message.GetRepeatedFixed64(0));
+ Assert.AreEqual(207u, message.GetRepeatedFixed32(0));
+ Assert.AreEqual(208u, message.GetRepeatedFixed64(0));
Assert.AreEqual(209, message.GetRepeatedSfixed32(0));
Assert.AreEqual(210, message.GetRepeatedSfixed64(0));
Assert.AreEqual(211, message.GetRepeatedFloat(0));
@@ -464,12 +492,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(301, message.GetRepeatedInt32(1));
Assert.AreEqual(302, message.GetRepeatedInt64(1));
- Assert.AreEqual(303, message.GetRepeatedUint32(1));
- Assert.AreEqual(304, message.GetRepeatedUint64(1));
+ Assert.AreEqual(303u, message.GetRepeatedUint32(1));
+ Assert.AreEqual(304u, message.GetRepeatedUint64(1));
Assert.AreEqual(305, message.GetRepeatedSint32(1));
Assert.AreEqual(306, message.GetRepeatedSint64(1));
- Assert.AreEqual(307, message.GetRepeatedFixed32(1));
- Assert.AreEqual(308, message.GetRepeatedFixed64(1));
+ Assert.AreEqual(307u, message.GetRepeatedFixed32(1));
+ Assert.AreEqual(308u, message.GetRepeatedFixed64(1));
Assert.AreEqual(309, message.GetRepeatedSfixed32(1));
Assert.AreEqual(310, message.GetRepeatedSfixed64(1));
Assert.AreEqual(311, message.GetRepeatedFloat(1), 0.0);
@@ -517,12 +545,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(401, message.DefaultInt32);
Assert.AreEqual(402, message.DefaultInt64);
- Assert.AreEqual(403, message.DefaultUint32);
- Assert.AreEqual(404, message.DefaultUint64);
+ Assert.AreEqual(403u, message.DefaultUint32);
+ Assert.AreEqual(404u, message.DefaultUint64);
Assert.AreEqual(405, message.DefaultSint32);
Assert.AreEqual(406, message.DefaultSint64);
- Assert.AreEqual(407, message.DefaultFixed32);
- Assert.AreEqual(408, message.DefaultFixed64);
+ Assert.AreEqual(407u, message.DefaultFixed32);
+ Assert.AreEqual(408u, message.DefaultFixed64);
Assert.AreEqual(409, message.DefaultSfixed32);
Assert.AreEqual(410, message.DefaultSfixed64);
Assert.AreEqual(411, message.DefaultFloat);
@@ -573,12 +601,12 @@ namespace Google.ProtocolBuffers
// Optional fields without defaults are set to zero or something like it.
Assert.AreEqual(0, message.OptionalInt32);
Assert.AreEqual(0, message.OptionalInt64);
- Assert.AreEqual(0, message.OptionalUint32);
- Assert.AreEqual(0, message.OptionalUint64);
+ Assert.AreEqual(0u, message.OptionalUint32);
+ Assert.AreEqual(0u, message.OptionalUint64);
Assert.AreEqual(0, message.OptionalSint32);
Assert.AreEqual(0, message.OptionalSint64);
- Assert.AreEqual(0, message.OptionalFixed32);
- Assert.AreEqual(0, message.OptionalFixed64);
+ Assert.AreEqual(0u, message.OptionalFixed32);
+ Assert.AreEqual(0u, message.OptionalFixed64);
Assert.AreEqual(0, message.OptionalSfixed32);
Assert.AreEqual(0, message.OptionalSfixed64);
Assert.AreEqual(0, message.OptionalFloat);
@@ -661,12 +689,12 @@ namespace Google.ProtocolBuffers
// Fields with defaults have their default values (duh).
Assert.AreEqual(41, message.DefaultInt32);
Assert.AreEqual(42, message.DefaultInt64);
- Assert.AreEqual(43, message.DefaultUint32);
- Assert.AreEqual(44, message.DefaultUint64);
+ Assert.AreEqual(43u, message.DefaultUint32);
+ Assert.AreEqual(44u, message.DefaultUint64);
Assert.AreEqual(-45, message.DefaultSint32);
Assert.AreEqual(46, message.DefaultSint64);
- Assert.AreEqual(47, message.DefaultFixed32);
- Assert.AreEqual(48, message.DefaultFixed64);
+ Assert.AreEqual(47u, message.DefaultFixed32);
+ Assert.AreEqual(48u, message.DefaultFixed64);
Assert.AreEqual(49, message.DefaultSfixed32);
Assert.AreEqual(-50, message.DefaultSfixed64);
Assert.AreEqual(51.5, message.DefaultFloat, 0.0);
@@ -1531,12 +1559,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(2, message.PackedEnumCount);
Assert.AreEqual(601, message.GetPackedInt32(0));
Assert.AreEqual(602, message.GetPackedInt64(0));
- Assert.AreEqual(603, message.GetPackedUint32(0));
- Assert.AreEqual(604, message.GetPackedUint64(0));
+ Assert.AreEqual(603u, message.GetPackedUint32(0));
+ Assert.AreEqual(604u, message.GetPackedUint64(0));
Assert.AreEqual(605, message.GetPackedSint32(0));
Assert.AreEqual(606, message.GetPackedSint64(0));
- Assert.AreEqual(607, message.GetPackedFixed32(0));
- Assert.AreEqual(608, message.GetPackedFixed64(0));
+ Assert.AreEqual(607u, message.GetPackedFixed32(0));
+ Assert.AreEqual(608u, message.GetPackedFixed64(0));
Assert.AreEqual(609, message.GetPackedSfixed32(0));
Assert.AreEqual(610, message.GetPackedSfixed64(0));
Assert.AreEqual(611, message.GetPackedFloat(0), 0.0);
@@ -1545,12 +1573,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetPackedEnum(0));
Assert.AreEqual(701, message.GetPackedInt32(1));
Assert.AreEqual(702, message.GetPackedInt64(1));
- Assert.AreEqual(703, message.GetPackedUint32(1));
- Assert.AreEqual(704, message.GetPackedUint64(1));
+ Assert.AreEqual(703u, message.GetPackedUint32(1));
+ Assert.AreEqual(704u, message.GetPackedUint64(1));
Assert.AreEqual(705, message.GetPackedSint32(1));
Assert.AreEqual(706, message.GetPackedSint64(1));
- Assert.AreEqual(707, message.GetPackedFixed32(1));
- Assert.AreEqual(708, message.GetPackedFixed64(1));
+ Assert.AreEqual(707u, message.GetPackedFixed32(1));
+ Assert.AreEqual(708u, message.GetPackedFixed64(1));
Assert.AreEqual(709, message.GetPackedSfixed32(1));
Assert.AreEqual(710, message.GetPackedSfixed64(1));
Assert.AreEqual(711, message.GetPackedFloat(1), 0.0);
@@ -1580,12 +1608,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(2, message.UnpackedEnumCount);
Assert.AreEqual(601, message.GetUnpackedInt32(0));
Assert.AreEqual(602, message.GetUnpackedInt64(0));
- Assert.AreEqual(603, message.GetUnpackedUint32(0));
- Assert.AreEqual(604, message.GetUnpackedUint64(0));
+ Assert.AreEqual(603u, message.GetUnpackedUint32(0));
+ Assert.AreEqual(604u, message.GetUnpackedUint64(0));
Assert.AreEqual(605, message.GetUnpackedSint32(0));
Assert.AreEqual(606, message.GetUnpackedSint64(0));
- Assert.AreEqual(607, message.GetUnpackedFixed32(0));
- Assert.AreEqual(608, message.GetUnpackedFixed64(0));
+ Assert.AreEqual(607u, message.GetUnpackedFixed32(0));
+ Assert.AreEqual(608u, message.GetUnpackedFixed64(0));
Assert.AreEqual(609, message.GetUnpackedSfixed32(0));
Assert.AreEqual(610, message.GetUnpackedSfixed64(0));
Assert.AreEqual(611, message.GetUnpackedFloat(0), 0.0);
@@ -1594,12 +1622,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetUnpackedEnum(0));
Assert.AreEqual(701, message.GetUnpackedInt32(1));
Assert.AreEqual(702, message.GetUnpackedInt64(1));
- Assert.AreEqual(703, message.GetUnpackedUint32(1));
- Assert.AreEqual(704, message.GetUnpackedUint64(1));
+ Assert.AreEqual(703u, message.GetUnpackedUint32(1));
+ Assert.AreEqual(704u, message.GetUnpackedUint64(1));
Assert.AreEqual(705, message.GetUnpackedSint32(1));
Assert.AreEqual(706, message.GetUnpackedSint64(1));
- Assert.AreEqual(707, message.GetUnpackedFixed32(1));
- Assert.AreEqual(708, message.GetUnpackedFixed64(1));
+ Assert.AreEqual(707u, message.GetUnpackedFixed32(1));
+ Assert.AreEqual(708u, message.GetUnpackedFixed64(1));
Assert.AreEqual(709, message.GetUnpackedSfixed32(1));
Assert.AreEqual(710, message.GetUnpackedSfixed64(1));
Assert.AreEqual(711, message.GetUnpackedFloat(1), 0.0);
@@ -1659,12 +1687,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedEnumExtension));
Assert.AreEqual(601, message.GetExtension(UnitTestProtoFile.PackedInt32Extension, 0));
Assert.AreEqual(602L, message.GetExtension(UnitTestProtoFile.PackedInt64Extension, 0));
- Assert.AreEqual(603, message.GetExtension(UnitTestProtoFile.PackedUint32Extension, 0));
- Assert.AreEqual(604L, message.GetExtension(UnitTestProtoFile.PackedUint64Extension, 0));
+ Assert.AreEqual(603u, message.GetExtension(UnitTestProtoFile.PackedUint32Extension, 0));
+ Assert.AreEqual(604uL, message.GetExtension(UnitTestProtoFile.PackedUint64Extension, 0));
Assert.AreEqual(605, message.GetExtension(UnitTestProtoFile.PackedSint32Extension, 0));
Assert.AreEqual(606L, message.GetExtension(UnitTestProtoFile.PackedSint64Extension, 0));
- Assert.AreEqual(607, message.GetExtension(UnitTestProtoFile.PackedFixed32Extension, 0));
- Assert.AreEqual(608L, message.GetExtension(UnitTestProtoFile.PackedFixed64Extension, 0));
+ Assert.AreEqual(607u, message.GetExtension(UnitTestProtoFile.PackedFixed32Extension, 0));
+ Assert.AreEqual(608uL, message.GetExtension(UnitTestProtoFile.PackedFixed64Extension, 0));
Assert.AreEqual(609, message.GetExtension(UnitTestProtoFile.PackedSfixed32Extension, 0));
Assert.AreEqual(610L, message.GetExtension(UnitTestProtoFile.PackedSfixed64Extension, 0));
Assert.AreEqual(611F, message.GetExtension(UnitTestProtoFile.PackedFloatExtension, 0));
@@ -1674,12 +1702,12 @@ namespace Google.ProtocolBuffers
message.GetExtension(UnitTestProtoFile.PackedEnumExtension, 0));
Assert.AreEqual(701, message.GetExtension(UnitTestProtoFile.PackedInt32Extension, 1));
Assert.AreEqual(702L, message.GetExtension(UnitTestProtoFile.PackedInt64Extension, 1));
- Assert.AreEqual(703, message.GetExtension(UnitTestProtoFile.PackedUint32Extension, 1));
- Assert.AreEqual(704L, message.GetExtension(UnitTestProtoFile.PackedUint64Extension, 1));
+ Assert.AreEqual(703u, message.GetExtension(UnitTestProtoFile.PackedUint32Extension, 1));
+ Assert.AreEqual(704uL, message.GetExtension(UnitTestProtoFile.PackedUint64Extension, 1));
Assert.AreEqual(705, message.GetExtension(UnitTestProtoFile.PackedSint32Extension, 1));
Assert.AreEqual(706L, message.GetExtension(UnitTestProtoFile.PackedSint64Extension, 1));
- Assert.AreEqual(707, message.GetExtension(UnitTestProtoFile.PackedFixed32Extension, 1));
- Assert.AreEqual(708L, message.GetExtension(UnitTestProtoFile.PackedFixed64Extension, 1));
+ Assert.AreEqual(707u, message.GetExtension(UnitTestProtoFile.PackedFixed32Extension, 1));
+ Assert.AreEqual(708uL, message.GetExtension(UnitTestProtoFile.PackedFixed64Extension, 1));
Assert.AreEqual(709, message.GetExtension(UnitTestProtoFile.PackedSfixed32Extension, 1));
Assert.AreEqual(710L, message.GetExtension(UnitTestProtoFile.PackedSfixed64Extension, 1));
Assert.AreEqual(711F, message.GetExtension(UnitTestProtoFile.PackedFloatExtension, 1));
@@ -1706,12 +1734,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedEnumExtension));
Assert.AreEqual(601, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt32Extension, 0));
Assert.AreEqual(602L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt64Extension, 0));
- Assert.AreEqual(603, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint32Extension, 0));
- Assert.AreEqual(604L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint64Extension, 0));
+ Assert.AreEqual(603u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint32Extension, 0));
+ Assert.AreEqual(604uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint64Extension, 0));
Assert.AreEqual(605, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint32Extension, 0));
Assert.AreEqual(606L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint64Extension, 0));
- Assert.AreEqual(607, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed32Extension, 0));
- Assert.AreEqual(608L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed64Extension, 0));
+ Assert.AreEqual(607u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed32Extension, 0));
+ Assert.AreEqual(608uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed64Extension, 0));
Assert.AreEqual(609, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed32Extension, 0));
Assert.AreEqual(610L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed64Extension, 0));
Assert.AreEqual(611F, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFloatExtension, 0));
@@ -1721,12 +1749,12 @@ namespace Google.ProtocolBuffers
message.GetExtension(UnitTestExtrasProtoFile.UnpackedEnumExtension, 0));
Assert.AreEqual(701, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt32Extension, 1));
Assert.AreEqual(702L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt64Extension, 1));
- Assert.AreEqual(703, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint32Extension, 1));
- Assert.AreEqual(704L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint64Extension, 1));
+ Assert.AreEqual(703u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint32Extension, 1));
+ Assert.AreEqual(704uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint64Extension, 1));
Assert.AreEqual(705, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint32Extension, 1));
Assert.AreEqual(706L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint64Extension, 1));
- Assert.AreEqual(707, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed32Extension, 1));
- Assert.AreEqual(708L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed64Extension, 1));
+ Assert.AreEqual(707u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed32Extension, 1));
+ Assert.AreEqual(708uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed64Extension, 1));
Assert.AreEqual(709, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed32Extension, 1));
Assert.AreEqual(710L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed64Extension, 1));
Assert.AreEqual(711F, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFloatExtension, 1));
@@ -1735,27 +1763,11 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(UnpackedExtensionsForeignEnum.FOREIGN_BAZ, message.GetExtension(UnitTestExtrasProtoFile.UnpackedEnumExtension, 1));
}
- private static ByteString goldenPackedFieldsMessage = null;
-
- /// <summary>
- /// Get the bytes of the "golden packed fields message". This is a serialized
- /// TestPackedTypes with all fields set as they would be by SetPackedFields,
- /// but it is loaded from a file on disk rather than generated dynamically.
- /// The file is actually generated by C++ code, so testing against it verifies compatibility
- /// with C++.
- /// </summary>
- public static ByteString GetGoldenPackedFieldsMessage()
- {
- if (goldenPackedFieldsMessage == null)
- {
- goldenPackedFieldsMessage = ReadBytesFromFile("golden_packed_fields_message");
- }
- return goldenPackedFieldsMessage;
- }
-
private static readonly string[] TestCultures = {"en-US", "en-GB", "fr-FR", "de-DE"};
- public static void TestInMultipleCultures(Action test)
+ public delegate void CultureAction();
+
+ public static void TestInMultipleCultures(CultureAction test)
{
CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
foreach (string culture in TestCultures)
@@ -1785,6 +1797,22 @@ namespace Google.ProtocolBuffers
return bytes;
}
+
+ internal delegate void Action();
+
+ internal static void AssertNotSupported(Action action)
+ {
+ try
+ {
+ action();
+ Assert.Fail("Expected NotSupportedException");
+ }
+ catch (NotSupportedException)
+ {
+ // Expected
+ }
+ }
+
internal static void AssertArgumentNullException(Action action)
{
try
@@ -1797,5 +1825,25 @@ namespace Google.ProtocolBuffers
// We expect this exception.
}
}
+
+ internal static void AssertBytesEqual(byte[] a, byte[]b)
+ {
+ if (a == null || b == null)
+ {
+ Assert.AreEqual<object>(a, b);
+ }
+ else
+ {
+ Assert.AreEqual(a.Length, b.Length, "The byte[] is not of the expected length.");
+
+ for (int i = 0; i < a.Length; i++)
+ {
+ if (a[i] != b[i])
+ {
+ Assert.AreEqual(a[i], b[i], "Byte[] differs at index " + i);
+ }
+ }
+ }
+ }
}
} \ No newline at end of file
diff --git a/src/ProtocolBuffers.Test/TestWriterFormatJson.cs b/src/ProtocolBuffers.Test/TestWriterFormatJson.cs
index 98215ebc..86a3e300 100644
--- a/src/ProtocolBuffers.Test/TestWriterFormatJson.cs
+++ b/src/ProtocolBuffers.Test/TestWriterFormatJson.cs
@@ -2,15 +2,15 @@ using System;
using System.IO;
using System.Text;
using Google.ProtocolBuffers.Serialization;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using Google.ProtocolBuffers.TestProtos;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class TestWriterFormatJson
{
- [Test]
+ [TestMethod]
public void Example_FromJson()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
@@ -22,7 +22,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(true, message.Valid);
}
- [Test]
+ [TestMethod]
public void Example_ToJson()
{
TestXmlMessage message =
@@ -36,7 +36,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(@"{""valid"":true}", json);
}
- [Test]
+ [TestMethod]
public void Example_WriteJsonUsingICodedOutputStream()
{
TestXmlMessage message =
@@ -63,7 +63,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void Example_ReadJsonUsingICodedInputStream()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
@@ -98,7 +98,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(Content.IndexOf(expect) >= 0, "Expected to find content '{0}' in: \r\n{1}", expect, Content);
}
- [Test]
+ [TestMethod]
public void TestToJsonParseFromJson()
{
TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build();
@@ -109,7 +109,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(msg, copy);
}
- [Test]
+ [TestMethod]
public void TestToJsonParseFromJsonReader()
{
TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build();
@@ -120,7 +120,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(msg, copy);
}
- [Test]
+ [TestMethod]
public void TestJsonFormatted()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -143,7 +143,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestEmptyMessage()
{
FormatterAssert(
@@ -152,7 +152,7 @@ namespace Google.ProtocolBuffers
@"{}"
);
}
- [Test]
+ [TestMethod]
public void TestRepeatedField()
{
FormatterAssert(
@@ -163,7 +163,7 @@ namespace Google.ProtocolBuffers
@"{""options"":[""ONE"",""TWO""]}"
);
}
- [Test]
+ [TestMethod]
public void TestNestedEmptyMessage()
{
FormatterAssert(
@@ -173,7 +173,7 @@ namespace Google.ProtocolBuffers
@"{""child"":{}}"
);
}
- [Test]
+ [TestMethod]
public void TestNestedMessage()
{
FormatterAssert(
@@ -183,7 +183,7 @@ namespace Google.ProtocolBuffers
@"{""child"":{""options"":[""TWO""]}}"
);
}
- [Test]
+ [TestMethod]
public void TestBooleanTypes()
{
FormatterAssert(
@@ -193,7 +193,7 @@ namespace Google.ProtocolBuffers
@"{""valid"":true}"
);
}
- [Test]
+ [TestMethod]
public void TestFullMessage()
{
FormatterAssert(
@@ -222,7 +222,7 @@ namespace Google.ProtocolBuffers
0x1010101010L.ToString()
);
}
- [Test]
+ [TestMethod]
public void TestMessageWithXmlText()
{
FormatterAssert(
@@ -232,7 +232,7 @@ namespace Google.ProtocolBuffers
@"{""text"":""<text><\/text>""}"
);
}
- [Test]
+ [TestMethod]
public void TestWithEscapeChars()
{
FormatterAssert(
@@ -242,7 +242,7 @@ namespace Google.ProtocolBuffers
"{\"text\":\" \\t <- \\\"leading space and trailing\\\" -> \\\\ \\uef54 \\u0000 \\u00ff \\uffff \\b \\f \\r \\n \\t \"}"
);
}
- [Test]
+ [TestMethod]
public void TestWithExtensionText()
{
FormatterAssert(
@@ -253,7 +253,7 @@ namespace Google.ProtocolBuffers
@"{""valid"":false,""extension_text"":"" extension text value ! ""}"
);
}
- [Test]
+ [TestMethod]
public void TestWithExtensionNumber()
{
FormatterAssert(
@@ -264,7 +264,7 @@ namespace Google.ProtocolBuffers
@"{""number"":42}"
);
}
- [Test]
+ [TestMethod]
public void TestWithExtensionArray()
{
FormatterAssert(
@@ -276,7 +276,7 @@ namespace Google.ProtocolBuffers
@"{""extension_number"":[100,101,102]}"
);
}
- [Test]
+ [TestMethod]
public void TestWithExtensionEnum()
{
FormatterAssert(
@@ -286,7 +286,7 @@ namespace Google.ProtocolBuffers
@"{""extension_enum"":""ONE""}"
);
}
- [Test]
+ [TestMethod]
public void TestMessageWithExtensions()
{
FormatterAssert(
@@ -308,7 +308,7 @@ namespace Google.ProtocolBuffers
@"""extension_message"":{""number"":42}"
);
}
- [Test]
+ [TestMethod]
public void TestMessageMissingExtensions()
{
TestXmlMessage original = TestXmlMessage.CreateBuilder()
@@ -340,7 +340,7 @@ namespace Google.ProtocolBuffers
Assert.AreNotEqual(original, copy);
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestMergeFields()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
@@ -350,7 +350,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("text", builder.Text);
Assert.AreEqual(411, builder.Number);
}
- [Test]
+ [TestMethod]
public void TestMessageArray()
{
JsonFormatWriter writer = JsonFormatWriter.CreateInstance().Formatted();
@@ -374,7 +374,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(3, ordinal);
Assert.AreEqual(3, builder.TextlinesCount);
}
- [Test]
+ [TestMethod]
public void TestNestedMessageArray()
{
JsonFormatWriter writer = JsonFormatWriter.CreateInstance();
@@ -403,7 +403,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(3, ordinal);
Assert.AreEqual(3, builder.TextlinesCount);
}
- [Test]
+ [TestMethod]
public void TestReadWriteJsonWithoutRoot()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
@@ -425,7 +425,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(message, copy);
}
- [Test,ExpectedException(typeof(RecursionLimitExceededException))]
+ [TestMethod,ExpectedException(typeof(RecursionLimitExceededException))]
public void TestRecursiveLimit()
{
StringBuilder sb = new StringBuilder(8192);
@@ -433,25 +433,25 @@ namespace Google.ProtocolBuffers
sb.Append("{\"child\":");
TestXmlRescursive msg = Extensions.MergeFromJson(new TestXmlRescursive.Builder(), sb.ToString()).Build();
}
- [Test, ExpectedException(typeof(FormatException))]
+ [TestMethod, ExpectedException(typeof(FormatException))]
public void FailWithEmptyText()
{
JsonFormatReader.CreateInstance("")
.Merge(TestXmlMessage.CreateBuilder());
}
- [Test, ExpectedException(typeof(FormatException))]
+ [TestMethod, ExpectedException(typeof(FormatException))]
public void FailWithUnexpectedValue()
{
JsonFormatReader.CreateInstance("{{}}")
.Merge(TestXmlMessage.CreateBuilder());
}
- [Test, ExpectedException(typeof(FormatException))]
+ [TestMethod, ExpectedException(typeof(FormatException))]
public void FailWithUnQuotedName()
{
JsonFormatReader.CreateInstance("{name:{}}")
.Merge(TestXmlMessage.CreateBuilder());
}
- [Test, ExpectedException(typeof(FormatException))]
+ [TestMethod, ExpectedException(typeof(FormatException))]
public void FailWithUnexpectedType()
{
JsonFormatReader.CreateInstance("{\"valid\":{}}")
diff --git a/src/ProtocolBuffers.Test/TestWriterFormatXml.cs b/src/ProtocolBuffers.Test/TestWriterFormatXml.cs
index aa4db875..13ea060b 100644
--- a/src/ProtocolBuffers.Test/TestWriterFormatXml.cs
+++ b/src/ProtocolBuffers.Test/TestWriterFormatXml.cs
@@ -4,15 +4,15 @@ using System.IO;
using System.Text;
using System.Xml;
using Google.ProtocolBuffers.Serialization;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using Google.ProtocolBuffers.TestProtos;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class TestWriterFormatXml
{
- [Test]
+ [TestMethod]
public void Example_FromXml()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
@@ -25,7 +25,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(true, message.Valid);
}
- [Test]
+ [TestMethod]
public void Example_ToXml()
{
TestXmlMessage message =
@@ -39,7 +39,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(@"<root><valid>true</valid></root>", Xml);
}
- [Test]
+ [TestMethod]
public void Example_WriteXmlUsingICodedOutputStream()
{
TestXmlMessage message =
@@ -60,7 +60,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void Example_ReadXmlUsingICodedInputStream()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
@@ -73,7 +73,7 @@ namespace Google.ProtocolBuffers
reader.ReadMessageEnd(); //manually read the end message '}'
}
- [Test]
+ [TestMethod]
public void TestToXmlParseFromXml()
{
TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build();
@@ -84,7 +84,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(msg, copy);
}
- [Test]
+ [TestMethod]
public void TestToXmlParseFromXmlWithRootName()
{
TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build();
@@ -95,14 +95,14 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(msg, copy);
}
- [Test]
+ [TestMethod]
public void TestEmptyMessage()
{
TestXmlChild message = TestXmlChild.CreateBuilder()
.Build();
StringWriter sw = new StringWriter();
- XmlTextWriter xw = new XmlTextWriter(sw);
+ XmlWriter xw = XmlWriter.Create(sw);
//When we call message.WriteTo, we are responsible for the root element
xw.WriteStartElement("root");
@@ -115,7 +115,7 @@ namespace Google.ProtocolBuffers
TestXmlChild copy = rdr.Merge(TestXmlChild.CreateBuilder()).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestRepeatedField()
{
TestXmlChild message = TestXmlChild.CreateBuilder()
@@ -132,7 +132,7 @@ namespace Google.ProtocolBuffers
TestXmlChild copy = rdr.Merge(TestXmlChild.CreateBuilder()).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestNestedEmptyMessage()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -147,7 +147,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestNestedMessage()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -162,7 +162,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestBooleanTypes()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -177,7 +177,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestFullMessage()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -206,7 +206,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestFullMessageWithRichTypes()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -238,7 +238,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestFullMessageWithUnknownFields()
{
TestXmlMessage origial = TestXmlMessage.CreateBuilder()
@@ -281,7 +281,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build();
Assert.AreEqual(TestXmlMessage.DefaultInstance, copy);
}
- [Test]
+ [TestMethod]
public void TestMessageWithXmlText()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -296,7 +296,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestXmlWithWhitespace()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -311,7 +311,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestXmlWithExtensionText()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -330,7 +330,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestXmlWithExtensionMessage()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -349,7 +349,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestXmlWithExtensionArray()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -370,7 +370,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestXmlWithExtensionEnum()
{
TestXmlMessage message = TestXmlMessage.CreateBuilder()
@@ -389,7 +389,7 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build();
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestXmlReadEmptyRoot()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
@@ -402,7 +402,7 @@ namespace Google.ProtocolBuffers
reader.ReadMessageEnd(); //manually read the end message '}'
}
- [Test]
+ [TestMethod]
public void TestXmlReadEmptyChild()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
@@ -415,7 +415,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(String.Empty, builder.Text);
}
- [Test]
+ [TestMethod]
public void TestXmlReadWriteWithoutRoot()
{
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
@@ -443,7 +443,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(message, copy);
}
- [Test, ExpectedException(typeof(RecursionLimitExceededException))]
+ [TestMethod, ExpectedException(typeof(RecursionLimitExceededException))]
public void TestRecursiveLimit()
{
StringBuilder sb = new StringBuilder(8192);
diff --git a/src/ProtocolBuffers.Test/TextFormatTest.cs b/src/ProtocolBuffers.Test/TextFormatTest.cs
index 49dac251..299b2650 100644
--- a/src/ProtocolBuffers.Test/TextFormatTest.cs
+++ b/src/ProtocolBuffers.Test/TextFormatTest.cs
@@ -38,13 +38,13 @@ using System;
using System.IO;
using System.Text;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization;
using System.Threading;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class TextFormatTest
{
private static readonly string AllFieldsSetText = TestUtil.ReadTextFromFile("text_format_unittest_data.txt");
@@ -90,7 +90,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Print TestAllTypes and compare with golden file.
/// </summary>
- [Test]
+ [TestMethod]
public void PrintMessage()
{
TestUtil.TestInMultipleCultures(() =>
@@ -104,7 +104,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Print TestAllExtensions and compare with golden file.
/// </summary>
- [Test]
+ [TestMethod]
public void PrintExtensions()
{
string text = TextFormat.PrintToString(TestUtil.GetAllExtensionsSet());
@@ -115,7 +115,7 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Test printing of unknown fields in a message.
/// </summary>
- [Test]
+ [TestMethod]
public void PrintUnknownFields()
{
TestEmptyMessage message =
@@ -178,7 +178,7 @@ namespace Google.ProtocolBuffers
return ByteString.CopyFrom(Encoding.GetEncoding(28591).GetBytes(str));
}
- [Test]
+ [TestMethod]
public void PrintExotic()
{
IMessage message = TestAllTypes.CreateBuilder()
@@ -212,7 +212,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(ExoticText, message.ToString());
}
- [Test]
+ [TestMethod]
public void PrintMessageSet()
{
TestMessageSet messageSet =
@@ -230,7 +230,7 @@ namespace Google.ProtocolBuffers
// =================================================================
- [Test]
+ [TestMethod]
public void Parse()
{
TestUtil.TestInMultipleCultures(() =>
@@ -241,7 +241,7 @@ namespace Google.ProtocolBuffers
});
}
- [Test]
+ [TestMethod]
public void ParseReader()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -249,7 +249,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllFieldsSet(builder.Build());
}
- [Test]
+ [TestMethod]
public void ParseExtensions()
{
TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
@@ -259,7 +259,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllExtensionsSet(builder.Build());
}
- [Test]
+ [TestMethod]
public void ParseCompatibility()
{
string original = "repeated_float: inf\n" +
@@ -291,7 +291,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(canonical, builder.Build().ToString());
}
- [Test]
+ [TestMethod]
public void ParseExotic()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -302,7 +302,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(ExoticText, builder.Build().ToString());
}
- [Test]
+ [TestMethod]
public void ParseMessageSet()
{
ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance();
@@ -319,7 +319,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str);
}
- [Test]
+ [TestMethod]
public void ParseNumericEnum()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -327,7 +327,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, builder.OptionalNestedEnum);
}
- [Test]
+ [TestMethod]
public void ParseAngleBrackets()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -336,7 +336,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(1, builder.OptionalGroup.A);
}
- [Test]
+ [TestMethod]
public void ParseComment()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
@@ -364,7 +364,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void ParseErrors()
{
AssertParseError(
@@ -454,7 +454,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void Escape()
{
// Escape sequences.
@@ -481,7 +481,7 @@ namespace Google.ProtocolBuffers
AssertFormatException(() => TextFormat.UnescapeText("\\"));
}
- [Test]
+ [TestMethod]
public void ParseInteger()
{
Assert.AreEqual(0, TextFormat.ParseInt32("0"));
@@ -492,10 +492,10 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(2147483647, TextFormat.ParseInt32("2147483647"));
Assert.AreEqual(-2147483648, TextFormat.ParseInt32("-2147483648"));
- Assert.AreEqual(0, TextFormat.ParseUInt32("0"));
- Assert.AreEqual(1, TextFormat.ParseUInt32("1"));
- Assert.AreEqual(12345, TextFormat.ParseUInt32("12345"));
- Assert.AreEqual(2147483647, TextFormat.ParseUInt32("2147483647"));
+ Assert.AreEqual(0u, TextFormat.ParseUInt32("0"));
+ Assert.AreEqual(1u, TextFormat.ParseUInt32("1"));
+ Assert.AreEqual(12345u, TextFormat.ParseUInt32("12345"));
+ Assert.AreEqual(2147483647u, TextFormat.ParseUInt32("2147483647"));
Assert.AreEqual(2147483648U, TextFormat.ParseUInt32("2147483648"));
Assert.AreEqual(4294967295U, TextFormat.ParseUInt32("4294967295"));
@@ -511,12 +511,12 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(9223372036854775807L, TextFormat.ParseInt64("9223372036854775807"));
Assert.AreEqual(-9223372036854775808L, TextFormat.ParseInt64("-9223372036854775808"));
- Assert.AreEqual(0L, TextFormat.ParseUInt64("0"));
- Assert.AreEqual(1L, TextFormat.ParseUInt64("1"));
- Assert.AreEqual(12345L, TextFormat.ParseUInt64("12345"));
- Assert.AreEqual(2147483647L, TextFormat.ParseUInt64("2147483647"));
- Assert.AreEqual(4294967295L, TextFormat.ParseUInt64("4294967295"));
- Assert.AreEqual(4294967296L, TextFormat.ParseUInt64("4294967296"));
+ Assert.AreEqual(0uL, TextFormat.ParseUInt64("0"));
+ Assert.AreEqual(1uL, TextFormat.ParseUInt64("1"));
+ Assert.AreEqual(12345uL, TextFormat.ParseUInt64("12345"));
+ Assert.AreEqual(2147483647uL, TextFormat.ParseUInt64("2147483647"));
+ Assert.AreEqual(4294967295uL, TextFormat.ParseUInt64("4294967295"));
+ Assert.AreEqual(4294967296uL, TextFormat.ParseUInt64("4294967296"));
Assert.AreEqual(9223372036854775807UL, TextFormat.ParseUInt64("9223372036854775807"));
Assert.AreEqual(9223372036854775808UL, TextFormat.ParseUInt64("9223372036854775808"));
Assert.AreEqual(18446744073709551615UL, TextFormat.ParseUInt64("18446744073709551615"));
@@ -543,7 +543,7 @@ namespace Google.ProtocolBuffers
AssertFormatException(() => TextFormat.ParseInt32("abcd"));
}
- [Test]
+ [TestMethod]
public void ParseLongString()
{
string longText =
diff --git a/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs b/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs
index bd3d950a..f9bfd84e 100644
--- a/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs
+++ b/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs
@@ -38,11 +38,11 @@ using System;
using System.Collections.Generic;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class UnknownFieldSetTest
{
private MessageDescriptor descriptor;
@@ -57,7 +57,7 @@ namespace Google.ProtocolBuffers
private UnknownFieldSet unknownFields;
- [SetUp]
+ [TestInitialize]
public void SetUp()
{
descriptor = TestAllTypes.Descriptor;
@@ -105,7 +105,7 @@ namespace Google.ProtocolBuffers
// =================================================================
- [Test]
+ [TestMethod]
public void Varint()
{
UnknownField field = GetField("optional_int32");
@@ -113,23 +113,23 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(allFields.OptionalInt32, (long) field.VarintList[0]);
}
- [Test]
+ [TestMethod]
public void Fixed32()
{
UnknownField field = GetField("optional_fixed32");
Assert.AreEqual(1, field.Fixed32List.Count);
- Assert.AreEqual(allFields.OptionalFixed32, (int) field.Fixed32List[0]);
+ Assert.AreEqual<long>(allFields.OptionalFixed32, (int) field.Fixed32List[0]);
}
- [Test]
+ [TestMethod]
public void Fixed64()
{
UnknownField field = GetField("optional_fixed64");
Assert.AreEqual(1, field.Fixed64List.Count);
- Assert.AreEqual(allFields.OptionalFixed64, (long) field.Fixed64List[0]);
+ Assert.AreEqual((long)allFields.OptionalFixed64, (long)field.Fixed64List[0]);
}
- [Test]
+ [TestMethod]
public void LengthDelimited()
{
UnknownField field = GetField("optional_bytes");
@@ -137,7 +137,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(allFields.OptionalBytes, field.LengthDelimitedList[0]);
}
- [Test]
+ [TestMethod]
public void Group()
{
FieldDescriptor nestedFieldDescriptor =
@@ -156,7 +156,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(allFields.OptionalGroup.A, (long) nestedField.VarintList[0]);
}
- [Test]
+ [TestMethod]
public void Serialize()
{
// Check that serializing the UnknownFieldSet produces the original data again.
@@ -164,7 +164,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(allFieldsData, data);
}
- [Test]
+ [TestMethod]
public void CopyFrom()
{
TestEmptyMessage message =
@@ -173,7 +173,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(emptyMessage.ToString(), message.ToString());
}
- [Test]
+ [TestMethod]
public void MergeFrom()
{
TestEmptyMessage source =
@@ -210,7 +210,7 @@ namespace Google.ProtocolBuffers
destination.ToString());
}
- [Test]
+ [TestMethod]
public void Clear()
{
UnknownFieldSet fields =
@@ -218,7 +218,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(0, fields.FieldDictionary.Count);
}
- [Test]
+ [TestMethod]
public void ClearMessage()
{
TestEmptyMessage message =
@@ -226,7 +226,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(0, message.SerializedSize);
}
- [Test]
+ [TestMethod]
public void ParseKnownAndUnknown()
{
// Test mixing known and unknown fields when parsing.
@@ -248,7 +248,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(654321, (long) field.VarintList[0]);
}
- [Test]
+ [TestMethod]
public void WrongTypeTreatedAsUnknown()
{
// Test that fields of the wrong wire type are treated like unknown fields
@@ -263,7 +263,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(emptyMessage.ToString(), allTypesMessage.ToString());
}
- [Test]
+ [TestMethod]
public void UnknownExtensions()
{
// Make sure fields are properly parsed to the UnknownFieldSet even when
@@ -277,7 +277,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(allFieldsData, message.ToByteString());
}
- [Test]
+ [TestMethod]
public void WrongExtensionTypeTreatedAsUnknown()
{
// Test that fields of the wrong wire type are treated like unknown fields
@@ -293,7 +293,7 @@ namespace Google.ProtocolBuffers
allExtensionsMessage.ToString());
}
- [Test]
+ [TestMethod]
public void ParseUnknownEnumValue()
{
FieldDescriptor singularField =
@@ -342,7 +342,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void LargeVarint()
{
ByteString data =
@@ -359,7 +359,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(0x7FFFFFFFFFFFFFFFUL, field.VarintList[0]);
}
- [Test]
+ [TestMethod]
public void EqualsAndHashCode()
{
UnknownField fixed32Field = UnknownField.CreateBuilder().AddFixed32(1).Build();
diff --git a/src/ProtocolBuffers.Test/WireFormatTest.cs b/src/ProtocolBuffers.Test/WireFormatTest.cs
index e390ce0d..415624e5 100644
--- a/src/ProtocolBuffers.Test/WireFormatTest.cs
+++ b/src/ProtocolBuffers.Test/WireFormatTest.cs
@@ -38,17 +38,17 @@ using System.IO;
using System.Reflection;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class WireFormatTest
{
/// <summary>
/// Keeps the attributes on FieldType and the switch statement in WireFormat in sync.
/// </summary>
- [Test]
+ [TestMethod]
public void FieldTypeToWireTypeMapping()
{
foreach (FieldInfo field in typeof (FieldType).GetFields(BindingFlags.Static | BindingFlags.Public))
@@ -60,7 +60,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void Serialization()
{
TestAllTypes message = TestUtil.GetAllSet();
@@ -73,7 +73,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllFieldsSet(message2);
}
- [Test]
+ [TestMethod]
public void SerializationPacked()
{
TestPackedTypes message = TestUtil.GetPackedSet();
@@ -83,7 +83,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertPackedFieldsSet(message2);
}
- [Test]
+ [TestMethod]
public void SerializeExtensions()
{
// TestAllTypes and TestAllExtensions should have compatible wire formats,
@@ -98,7 +98,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllFieldsSet(message2);
}
- [Test]
+ [TestMethod]
public void SerializePackedExtensions()
{
// TestPackedTypes and TestPackedExtensions should have compatible wire
@@ -112,7 +112,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(rawBytes, rawBytes2);
}
- [Test]
+ [TestMethod]
public void SerializeDelimited()
{
MemoryStream stream = new MemoryStream();
@@ -130,7 +130,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(-1, stream.ReadByte());
}
- [Test]
+ [TestMethod]
public void ParseExtensions()
{
// TestAllTypes and TestAllExtensions should have compatible wire formats,
@@ -149,7 +149,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllExtensionsSet(message2);
}
- [Test]
+ [TestMethod]
public void ParsePackedExtensions()
{
// Ensure that packed extensions can be properly parsed.
@@ -162,7 +162,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertPackedExtensionsSet(message2);
}
- [Test]
+ [TestMethod]
public void ExtensionsSerializedSize()
{
Assert.AreEqual(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize);
@@ -183,7 +183,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void InterleavedFieldsAndExtensions()
{
// Tests that fields are written in order even when extension ranges
@@ -214,7 +214,7 @@ namespace Google.ProtocolBuffers
private static readonly int TypeId1 = TestMessageSetExtension1.Descriptor.Extensions[0].FieldNumber;
private static readonly int TypeId2 = TestMessageSetExtension2.Descriptor.Extensions[0].FieldNumber;
- [Test]
+ [TestMethod]
public void SerializeMessageSet()
{
// Set up a TestMessageSet with two known messages and an unknown one.
@@ -256,7 +256,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("bar", raw.GetItem(2).Message.ToStringUtf8());
}
- [Test]
+ [TestMethod]
public void ParseMessageSet()
{
ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance();
diff --git a/src/ProtocolBuffers.sln b/src/ProtocolBuffers.sln
index 62f9a26f..f9c75502 100644
--- a/src/ProtocolBuffers.sln
+++ b/src/ProtocolBuffers.sln
@@ -75,6 +75,28 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serializati
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers(Silverlight)", "ProtocolBuffers\ProtocolBuffers(Silverlight).csproj", "{7E4E681E-5D09-43FB-8D9E-35A454730A85}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite(Silverlight)", "ProtocolBuffers\ProtocolBuffersLite(Silverlight).csproj", "{2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C7B69674-7A51-4AC6-8674-0330BA742CE4}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{75D5D25A-01A6-4594-957F-5993FB83F450}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization(Silverlight)", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization(Silverlight).csproj", "{72B69A15-E28E-4738-A779-18D76C87D225}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization(Silverlight)", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization(Silverlight).csproj", "{B6CDC03B-EBBD-4F38-9F84-736EC0948090}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test(Silverlight)", "ProtocolBuffers.Test\ProtocolBuffers.Test(Silverlight).csproj", "{D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Silverlight", "Silverlight", "{AC305C07-0DBD-4247-B458-1B739F84F172}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test(Silverlight)", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test(Silverlight).csproj", "{C56950B0-9F97-4250-8945-4B3C2D441FEA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test(Silverlight)", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test(Silverlight).csproj", "{63B8D05E-4581-4B92-B8D5-77E702535C7F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Silverlight|Any CPU = Debug_Silverlight|Any CPU
@@ -83,12 +105,10 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
- {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
- {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
@@ -133,12 +153,10 @@ Global
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU
- {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
- {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
- {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
@@ -153,27 +171,80 @@ Global
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
- {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
- {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
- {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU
- {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
- {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
- {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{C8D3015A-EA39-4F03-AEEC-3FF1F2087A12} = {1F896D5C-5FC2-4671-9216-781CB8187EC7}
+ {C268DA4C-4004-47DA-AF23-44C983281A68} = {C7B69674-7A51-4AC6-8674-0330BA742CE4}
+ {EE01ED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4}
+ {EEFFED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4}
+ {DD01ED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4}
+ {A31F5FB2-4FF3-432A-B35B-5CD203606311} = {75D5D25A-01A6-4594-957F-5993FB83F450}
+ {C7A4A435-2813-41C8-AA87-BD914BA5223D} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}
+ {D7282E99-2DC3-405B-946F-177DB2FD2AE2} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}
+ {8F09AF72-3327-4FA7-BC09-070B80221AB9} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {72B69A15-E28E-4738-A779-18D76C87D225} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F} = {AC305C07-0DBD-4247-B458-1B739F84F172}
EndGlobalSection
EndGlobal
diff --git a/src/ProtocolBuffers/ProtocolBuffers(Silverlight).csproj b/src/ProtocolBuffers/ProtocolBuffers(Silverlight).csproj
new file mode 100644
index 00000000..c539c68f
--- /dev/null
+++ b/src/ProtocolBuffers/ProtocolBuffers(Silverlight).csproj
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{7E4E681E-5D09-43FB-8D9E-35A454730A85}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers</RootNamespace>
+ <AssemblyName>Google.ProtocolBuffers</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <SilverlightApplication>false</SilverlightApplication>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <ValidateXaml>true</ValidateXaml>
+ <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug_Silverlight\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release_Silverlight\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AbstractBuilder.cs" />
+ <Compile Include="AbstractBuilderLite.cs" />
+ <Compile Include="AbstractMessage.cs" />
+ <Compile Include="AbstractMessageLite.cs" />
+ <Compile Include="ByteArray.cs" />
+ <Compile Include="ByteString.cs" />
+ <Compile Include="Collections\Enumerables.cs" />
+ <Compile Include="Collections\IPopsicleList.cs" />
+ <Compile Include="Collections\PopsicleList.cs" />
+ <Compile Include="CodedOutputStream.ComputeSize.cs" />
+ <Compile Include="CustomSerialization.cs" />
+ <Compile Include="Delegates.cs" />
+ <Compile Include="CodedInputStream.cs" />
+ <Compile Include="CodedOutputStream.cs" />
+ <Compile Include="Collections\Dictionaries.cs" />
+ <Compile Include="Collections\Lists.cs" />
+ <Compile Include="Collections\ReadOnlyDictionary.cs" />
+ <Compile Include="DescriptorProtos\CSharpOptions.cs" />
+ <Compile Include="DescriptorProtos\DescriptorProtoFile.cs" />
+ <Compile Include="DescriptorProtos\IDescriptorProto.cs" />
+ <Compile Include="DescriptorProtos\PartialClasses.cs" />
+ <Compile Include="Descriptors\DescriptorBase.cs" />
+ <Compile Include="Descriptors\DescriptorPool.cs" />
+ <Compile Include="Descriptors\DescriptorUtil.cs" />
+ <Compile Include="Descriptors\DescriptorValidationException.cs" />
+ <Compile Include="Descriptors\EnumDescriptor.cs" />
+ <Compile Include="Descriptors\EnumValueDescriptor.cs" />
+ <Compile Include="Descriptors\FieldDescriptor.cs" />
+ <Compile Include="Descriptors\FieldMappingAttribute.cs" />
+ <Compile Include="Descriptors\FieldType.cs" />
+ <Compile Include="Descriptors\FileDescriptor.cs" />
+ <Compile Include="Descriptors\IDescriptor.cs" />
+ <Compile Include="Descriptors\IndexedDescriptorBase.cs" />
+ <Compile Include="Descriptors\MappedType.cs" />
+ <Compile Include="Descriptors\MessageDescriptor.cs" />
+ <Compile Include="Descriptors\MethodDescriptor.cs" />
+ <Compile Include="Descriptors\PackageDescriptor.cs" />
+ <Compile Include="Descriptors\ServiceDescriptor.cs" />
+ <Compile Include="DynamicMessage.cs" />
+ <Compile Include="EnumLite.cs" />
+ <Compile Include="ExtendableBuilder.cs" />
+ <Compile Include="ExtendableBuilderLite.cs" />
+ <Compile Include="ExtendableMessage.cs" />
+ <Compile Include="ExtendableMessageLite.cs" />
+ <Compile Include="ExtensionInfo.cs" />
+ <Compile Include="ExtensionRegistry.cs" />
+ <Compile Include="ExtensionRegistryLite.cs" />
+ <Compile Include="FieldAccess\ReflectionUtil.cs" />
+ <Compile Include="FieldAccess\SingleEnumAccessor.cs" />
+ <Compile Include="FieldAccess\SingleMessageAccessor.cs" />
+ <Compile Include="FieldAccess\SinglePrimitiveAccessor.cs" />
+ <Compile Include="FieldAccess\RepeatedPrimitiveAccessor.cs" />
+ <Compile Include="FieldAccess\RepeatedEnumAccessor.cs" />
+ <Compile Include="FieldAccess\IFieldAccessor.cs" />
+ <Compile Include="FieldAccess\FieldAccessorTable.cs" />
+ <Compile Include="FieldAccess\RepeatedMessageAccessor.cs" />
+ <Compile Include="FieldSet.cs" />
+ <Compile Include="GeneratedBuilder.cs" />
+ <Compile Include="GeneratedBuilderLite.cs" />
+ <Compile Include="GeneratedExtensionLite.cs" />
+ <Compile Include="GeneratedMessageLite.cs" />
+ <Compile Include="GeneratedRepeatExtension.cs" />
+ <Compile Include="GeneratedSingleExtension.cs" />
+ <Compile Include="GeneratedMessage.cs" />
+ <Compile Include="IBuilder.cs" />
+ <Compile Include="GeneratedExtensionBase.cs" />
+ <Compile Include="IBuilderLite.cs" />
+ <Compile Include="ICodedInputStream.cs" />
+ <Compile Include="ICodedOutputStream.cs" />
+ <Compile Include="IMessage.cs" />
+ <Compile Include="IMessageLite.cs" />
+ <Compile Include="InvalidProtocolBufferException.cs" />
+ <Compile Include="IRpcChannel.cs" />
+ <Compile Include="IRpcController.cs" />
+ <Compile Include="IRpcDispatch.cs" />
+ <Compile Include="IService.cs" />
+ <Compile Include="MessageStreamIterator.cs" />
+ <Compile Include="MessageStreamWriter.cs" />
+ <Compile Include="MessageUtil.cs" />
+ <Compile Include="NameHelpers.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="RpcUtil.cs" />
+ <Compile Include="SilverlightCompatibility.cs" />
+ <Compile Include="SortedList.cs" />
+ <Compile Include="TextFormat.cs" />
+ <Compile Include="TextGenerator.cs" />
+ <Compile Include="TextTokenizer.cs" />
+ <Compile Include="ThrowHelper.cs" />
+ <Compile Include="UninitializedMessageException.cs" />
+ <Compile Include="UnknownField.cs" />
+ <Compile Include="UnknownFieldSet.cs" />
+ <Compile Include="WireFormat.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffers/ProtocolBuffers.csproj b/src/ProtocolBuffers/ProtocolBuffers.csproj
index 6edab53e..e473f8b5 100644
--- a/src/ProtocolBuffers/ProtocolBuffers.csproj
+++ b/src/ProtocolBuffers/ProtocolBuffers.csproj
@@ -14,27 +14,7 @@
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -47,7 +27,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -59,32 +38,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU'">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug_Silverlight\</OutputPath>
- <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
- <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU'">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release_Silverlight\</OutputPath>
- <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
- <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
@@ -93,13 +46,9 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AbstractBuilder.cs" />
- <Compile Include="AbstractBuilderLite.cs">
- <SubType>Code</SubType>
- </Compile>
+ <Compile Include="AbstractBuilderLite.cs" />
<Compile Include="AbstractMessage.cs" />
- <Compile Include="AbstractMessageLite.cs">
- <SubType>Code</SubType>
- </Compile>
+ <Compile Include="AbstractMessageLite.cs" />
<Compile Include="ByteArray.cs" />
<Compile Include="ByteString.cs" />
<Compile Include="Collections\Enumerables.cs" />
@@ -140,9 +89,7 @@
<Compile Include="ExtendableBuilderLite.cs" />
<Compile Include="ExtendableMessage.cs" />
<Compile Include="ExtendableMessageLite.cs" />
- <Compile Include="ExtensionInfo.cs">
- <SubType>Code</SubType>
- </Compile>
+ <Compile Include="ExtensionInfo.cs" />
<Compile Include="ExtensionRegistry.cs" />
<Compile Include="ExtensionRegistryLite.cs" />
<Compile Include="FieldAccess\ReflectionUtil.cs" />
@@ -164,9 +111,7 @@
<Compile Include="GeneratedMessage.cs" />
<Compile Include="IBuilder.cs" />
<Compile Include="GeneratedExtensionBase.cs" />
- <Compile Include="IBuilderLite.cs">
- <SubType>Code</SubType>
- </Compile>
+ <Compile Include="IBuilderLite.cs" />
<Compile Include="ICodedInputStream.cs" />
<Compile Include="ICodedOutputStream.cs" />
<Compile Include="IMessage.cs" />
@@ -193,27 +138,7 @@
<Compile Include="UnknownFieldSet.cs" />
<Compile Include="WireFormat.cs" />
</ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Debug' " />
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Release' " />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(Configuration)' == 'Debug_Silverlight' " />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(Configuration)' == 'Release_Silverlight' " />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/src/ProtocolBuffers/ProtocolBuffersLite(Silverlight).csproj b/src/ProtocolBuffers/ProtocolBuffersLite(Silverlight).csproj
new file mode 100644
index 00000000..7e2dc298
--- /dev/null
+++ b/src/ProtocolBuffers/ProtocolBuffersLite(Silverlight).csproj
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers</RootNamespace>
+ <AssemblyName>Google.ProtocolBuffersLite</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <SilverlightApplication>false</SilverlightApplication>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <ValidateXaml>true</ValidateXaml>
+ <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug_Silverlight\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;LITE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release_Silverlight\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>TRACE;SILVERLIGHT;LITE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AbstractBuilderLite.cs" />
+ <Compile Include="AbstractMessageLite.cs" />
+ <Compile Include="ByteArray.cs" />
+ <Compile Include="CodedOutputStream.ComputeSize.cs" />
+ <Compile Include="Collections\Dictionaries.cs" />
+ <Compile Include="Collections\Enumerables.cs" />
+ <Compile Include="Collections\IPopsicleList.cs" />
+ <Compile Include="Collections\Lists.cs" />
+ <Compile Include="Collections\PopsicleList.cs" />
+ <Compile Include="Collections\ReadOnlyDictionary.cs" />
+ <Compile Include="CustomSerialization.cs" />
+ <Compile Include="Descriptors\FieldMappingAttribute.cs" />
+ <Compile Include="Descriptors\FieldType.cs" />
+ <Compile Include="Descriptors\MappedType.cs" />
+ <Compile Include="EnumLite.cs" />
+ <Compile Include="ExtendableBuilderLite.cs" />
+ <Compile Include="ExtendableMessageLite.cs" />
+ <Compile Include="FieldSet.cs" />
+ <Compile Include="GeneratedBuilderLite.cs" />
+ <Compile Include="GeneratedExtensionLite.cs" />
+ <Compile Include="GeneratedMessageLite.cs" />
+ <Compile Include="ICodedInputStream.cs" />
+ <Compile Include="ICodedOutputStream.cs" />
+ <Compile Include="IRpcDispatch.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="ByteString.cs" />
+ <Compile Include="CodedInputStream.cs" />
+ <Compile Include="CodedOutputStream.cs" />
+ <Compile Include="ExtensionRegistryLite.cs" />
+ <Compile Include="IBuilderLite.cs" />
+ <Compile Include="IMessageLite.cs" />
+ <Compile Include="InvalidProtocolBufferException.cs" />
+ <Compile Include="SortedList.cs" />
+ <Compile Include="ThrowHelper.cs" />
+ <Compile Include="UninitializedMessageException.cs" />
+ <Compile Include="WireFormat.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.csproj
index 0162d6f1..4773c5ad 100644
--- a/src/ProtocolBuffers/ProtocolBuffersLite.csproj
+++ b/src/ProtocolBuffers/ProtocolBuffersLite.csproj
@@ -14,11 +14,7 @@
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
- <UpgradeBackupLocation />
- <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -27,7 +23,7 @@
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>TRACE;DEBUG;LITE</DefineConstants>
+ <DefineConstants>DEBUG;TRACE;LITE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
@@ -43,39 +39,12 @@
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU'">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug_Silverlight\</OutputPath>
- <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
- <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>DEBUG;TRACE;SILVERLIGHT;LITE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU'">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release_Silverlight\</OutputPath>
- <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
- <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
- <DefineConstants>TRACE;SILVERLIGHT;LITE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <NoStdLib>true</NoStdLib>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- </ItemGroup>
- <ItemGroup>
<Compile Include="AbstractBuilderLite.cs" />
<Compile Include="AbstractMessageLite.cs" />
<Compile Include="ByteArray.cs" />
@@ -106,19 +75,14 @@
<Compile Include="CodedOutputStream.cs" />
<Compile Include="ExtensionRegistryLite.cs" />
<Compile Include="IBuilderLite.cs" />
- <Compile Include="IMessageLite.cs">
- <SubType>Code</SubType>
- </Compile>
+ <Compile Include="IMessageLite.cs" />
<Compile Include="InvalidProtocolBufferException.cs" />
<Compile Include="SortedList.cs" />
<Compile Include="ThrowHelper.cs" />
<Compile Include="UninitializedMessageException.cs" />
<Compile Include="WireFormat.cs" />
</ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Debug' " />
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Release' " />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(Configuration)' == 'Debug_Silverlight' " />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(Configuration)' == 'Release_Silverlight' " />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/src/ProtocolBuffers/ThrowHelper.cs b/src/ProtocolBuffers/ThrowHelper.cs
index c854a777..f04a7f16 100644
--- a/src/ProtocolBuffers/ThrowHelper.cs
+++ b/src/ProtocolBuffers/ThrowHelper.cs
@@ -79,5 +79,14 @@ namespace Google.ProtocolBuffers
}
}
}
+
+ public static Exception CreateMissingMethod(Type type, string methodName)
+ {
+#if SILVERLIGHT
+ return new MissingMethodException(String.Format("The method '{0}' was not found on type {1}", methodName, type));
+#else
+ return new MissingMethodException(String.Format("{0}", type), methodName);
+#endif
+ }
}
} \ No newline at end of file
diff --git a/src/ProtocolBuffers2008.sln b/src/ProtocolBuffers2008.sln
index 286bdaaf..e174eddb 100644
--- a/src/ProtocolBuffers2008.sln
+++ b/src/ProtocolBuffers2008.sln
@@ -75,6 +75,28 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serializati
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers(Silverlight)", "ProtocolBuffers\ProtocolBuffers(Silverlight).csproj", "{7E4E681E-5D09-43FB-8D9E-35A454730A85}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite(Silverlight)", "ProtocolBuffers\ProtocolBuffersLite(Silverlight).csproj", "{2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C7B69674-7A51-4AC6-8674-0330BA742CE4}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{75D5D25A-01A6-4594-957F-5993FB83F450}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization(Silverlight)", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization(Silverlight).csproj", "{72B69A15-E28E-4738-A779-18D76C87D225}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization(Silverlight)", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization(Silverlight).csproj", "{B6CDC03B-EBBD-4F38-9F84-736EC0948090}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test(Silverlight)", "ProtocolBuffers.Test\ProtocolBuffers.Test(Silverlight).csproj", "{D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Silverlight", "Silverlight", "{AC305C07-0DBD-4247-B458-1B739F84F172}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test(Silverlight)", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test(Silverlight).csproj", "{C56950B0-9F97-4250-8945-4B3C2D441FEA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test(Silverlight)", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test(Silverlight).csproj", "{63B8D05E-4581-4B92-B8D5-77E702535C7F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Silverlight|Any CPU = Debug_Silverlight|Any CPU
@@ -83,12 +105,10 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
- {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
- {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
@@ -133,12 +153,10 @@ Global
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU
- {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
- {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
- {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
@@ -153,27 +171,80 @@ Global
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
- {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
- {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
- {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU
- {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
- {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
- {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {72B69A15-E28E-4738-A779-18D76C87D225}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{C8D3015A-EA39-4F03-AEEC-3FF1F2087A12} = {1F896D5C-5FC2-4671-9216-781CB8187EC7}
+ {C268DA4C-4004-47DA-AF23-44C983281A68} = {C7B69674-7A51-4AC6-8674-0330BA742CE4}
+ {EE01ED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4}
+ {EEFFED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4}
+ {DD01ED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4}
+ {A31F5FB2-4FF3-432A-B35B-5CD203606311} = {75D5D25A-01A6-4594-957F-5993FB83F450}
+ {C7A4A435-2813-41C8-AA87-BD914BA5223D} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}
+ {D7282E99-2DC3-405B-946F-177DB2FD2AE2} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}
+ {8F09AF72-3327-4FA7-BC09-070B80221AB9} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}
+ {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {72B69A15-E28E-4738-A779-18D76C87D225} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {B6CDC03B-EBBD-4F38-9F84-736EC0948090} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {7E4E681E-5D09-43FB-8D9E-35A454730A85} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {C56950B0-9F97-4250-8945-4B3C2D441FEA} = {AC305C07-0DBD-4247-B458-1B739F84F172}
+ {63B8D05E-4581-4B92-B8D5-77E702535C7F} = {AC305C07-0DBD-4247-B458-1B739F84F172}
EndGlobalSection
EndGlobal
diff --git a/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs b/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs
index 2a612a9c..2e5b11e8 100644
--- a/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs
+++ b/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs
@@ -39,14 +39,14 @@ using System.Collections.Generic;
using System.IO;
using Google.ProtocolBuffers;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class AbstractBuilderLiteTest
{
- [Test]
+ [TestMethod]
public void TestMergeFromCodedInputStream()
{
TestAllTypesLite copy,
@@ -62,10 +62,10 @@ namespace Google.ProtocolBuffers
copy = copy.ToBuilder().MergeFrom(ci).Build();
}
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestIBuilderLiteWeakClear()
{
TestAllTypesLite copy, msg = TestAllTypesLite.DefaultInstance;
@@ -74,10 +74,10 @@ namespace Google.ProtocolBuffers
Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray());
copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakClear().WeakBuild();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestBuilderLiteMergeFromCodedInputStream()
{
TestAllTypesLite copy,
@@ -89,10 +89,10 @@ namespace Google.ProtocolBuffers
copy =
copy.ToBuilder().MergeFrom(CodedInputStream.CreateInstance(new MemoryStream(msg.ToByteArray()))).Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestBuilderLiteMergeDelimitedFrom()
{
TestAllTypesLite copy,
@@ -105,10 +105,10 @@ namespace Google.ProtocolBuffers
msg.WriteDelimitedTo(s);
s.Position = 0;
copy = copy.ToBuilder().MergeDelimitedFrom(s).Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestBuilderLiteMergeDelimitedFromExtensions()
{
TestAllExtensionsLite copy,
@@ -127,11 +127,11 @@ namespace Google.ProtocolBuffers
UnitTestLiteProtoFile.RegisterAllExtensions(registry);
copy = copy.ToBuilder().MergeDelimitedFrom(s, registry).Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
Assert.AreEqual("Should be merged.", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestBuilderLiteMergeFromStream()
{
TestAllTypesLite copy,
@@ -144,10 +144,10 @@ namespace Google.ProtocolBuffers
msg.WriteTo(s);
s.Position = 0;
copy = copy.ToBuilder().MergeFrom(s).Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestBuilderLiteMergeFromStreamExtensions()
{
TestAllExtensionsLite copy,
@@ -166,11 +166,11 @@ namespace Google.ProtocolBuffers
UnitTestLiteProtoFile.RegisterAllExtensions(registry);
copy = copy.ToBuilder().MergeFrom(s, registry).Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
Assert.AreEqual("Should be merged.", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestIBuilderLiteWeakMergeFromIMessageLite()
{
TestAllTypesLite copy,
@@ -181,10 +181,10 @@ namespace Google.ProtocolBuffers
Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray());
copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom((IMessageLite) msg).WeakBuild();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestIBuilderLiteWeakMergeFromByteString()
{
TestAllTypesLite copy,
@@ -195,10 +195,10 @@ namespace Google.ProtocolBuffers
Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray());
copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString()).WeakBuild();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestIBuilderLiteWeakMergeFromByteStringExtensions()
{
TestAllExtensionsLite copy,
@@ -220,11 +220,11 @@ namespace Google.ProtocolBuffers
copy =
(TestAllExtensionsLite)
((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString(), registry).WeakBuild();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
Assert.AreEqual("Should be merged.", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestIBuilderLiteWeakMergeFromCodedInputStream()
{
TestAllTypesLite copy,
@@ -240,10 +240,10 @@ namespace Google.ProtocolBuffers
copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(ci).WeakBuild();
}
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestIBuilderLiteWeakBuildPartial()
{
IBuilderLite builder = TestRequiredLite.CreateBuilder();
@@ -252,10 +252,10 @@ namespace Google.ProtocolBuffers
IMessageLite msg = builder.WeakBuildPartial();
Assert.IsFalse(msg.IsInitialized);
- Assert.AreEqual(msg.ToByteArray(), TestRequiredLite.DefaultInstance.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), TestRequiredLite.DefaultInstance.ToByteArray());
}
- [Test, ExpectedException(typeof (UninitializedMessageException))]
+ [TestMethod, ExpectedException(typeof (UninitializedMessageException))]
public void TestIBuilderLiteWeakBuildUninitialized()
{
IBuilderLite builder = TestRequiredLite.CreateBuilder();
@@ -263,7 +263,7 @@ namespace Google.ProtocolBuffers
builder.WeakBuild();
}
- [Test]
+ [TestMethod]
public void TestIBuilderLiteWeakBuild()
{
IBuilderLite builder = TestRequiredLite.CreateBuilder()
@@ -273,7 +273,7 @@ namespace Google.ProtocolBuffers
builder.WeakBuild();
}
- [Test]
+ [TestMethod]
public void TestIBuilderLiteWeakClone()
{
TestRequiredLite msg = TestRequiredLite.CreateBuilder()
@@ -281,17 +281,17 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(msg.IsInitialized);
IMessageLite copy = ((IBuilderLite) msg.ToBuilder()).WeakClone().WeakBuild();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestIBuilderLiteWeakDefaultInstance()
{
Assert.IsTrue(ReferenceEquals(TestRequiredLite.DefaultInstance,
((IBuilderLite) TestRequiredLite.CreateBuilder()).WeakDefaultInstanceForType));
}
- [Test]
+ [TestMethod]
public void TestGeneratedBuilderLiteAddRange()
{
TestAllTypesLite copy,
@@ -303,7 +303,7 @@ namespace Google.ProtocolBuffers
.Build();
copy = msg.DefaultInstanceForType.ToBuilder().MergeFrom(msg).Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
}
} \ No newline at end of file
diff --git a/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs b/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs
index 5ef9636d..74eed574 100644
--- a/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs
+++ b/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs
@@ -39,14 +39,14 @@ using System.Collections.Generic;
using System.IO;
using Google.ProtocolBuffers;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class AbstractMessageLiteTest
{
- [Test]
+ [TestMethod]
public void TestMessageLiteToByteString()
{
TestRequiredLite msg = TestRequiredLite.CreateBuilder()
@@ -62,7 +62,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual((int) ExtraEnum.EXLITE_BAZ, b[3]);
}
- [Test]
+ [TestMethod]
public void TestMessageLiteToByteArray()
{
TestRequiredLite msg = TestRequiredLite.CreateBuilder()
@@ -75,7 +75,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(b, copy);
}
- [Test]
+ [TestMethod]
public void TestMessageLiteWriteTo()
{
TestRequiredLite msg = TestRequiredLite.CreateBuilder()
@@ -85,10 +85,10 @@ namespace Google.ProtocolBuffers
MemoryStream ms = new MemoryStream();
msg.WriteTo(ms);
- Assert.AreEqual(msg.ToByteArray(), ms.ToArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), ms.ToArray());
}
- [Test]
+ [TestMethod]
public void TestMessageLiteWriteDelimitedTo()
{
TestRequiredLite msg = TestRequiredLite.CreateBuilder()
@@ -104,17 +104,17 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(4, buffer[0]);
byte[] msgBytes = new byte[4];
Array.Copy(buffer, 1, msgBytes, 0, 4);
- Assert.AreEqual(msg.ToByteArray(), msgBytes);
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), msgBytes);
}
- [Test]
+ [TestMethod]
public void TestIMessageLiteWeakCreateBuilderForType()
{
IMessageLite msg = TestRequiredLite.DefaultInstance;
Assert.AreEqual(typeof (TestRequiredLite.Builder), msg.WeakCreateBuilderForType().GetType());
}
- [Test]
+ [TestMethod]
public void TestMessageLiteWeakToBuilder()
{
IMessageLite msg = TestRequiredLite.CreateBuilder()
@@ -123,10 +123,10 @@ namespace Google.ProtocolBuffers
.Build();
IMessageLite copy = msg.WeakToBuilder().WeakBuild();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestMessageLiteWeakDefaultInstanceForType()
{
IMessageLite msg = TestRequiredLite.DefaultInstance;
diff --git a/src/ProtocolBuffersLite.Test/App.xaml b/src/ProtocolBuffersLite.Test/App.xaml
new file mode 100644
index 00000000..d4f1f2e3
--- /dev/null
+++ b/src/ProtocolBuffersLite.Test/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="ProtocolBuffers.SilverlightTest.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/src/ProtocolBuffersLite.Test/App.xaml.cs b/src/ProtocolBuffersLite.Test/App.xaml.cs
new file mode 100644
index 00000000..0c9fd9e6
--- /dev/null
+++ b/src/ProtocolBuffersLite.Test/App.xaml.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Windows;
+using Microsoft.Silverlight.Testing;
+
+namespace Google.ProtocolBuffers
+{
+ public partial class App : Application
+ {
+
+ public App()
+ {
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+
+ //InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ this.RootVisual = UnitTestSystem.CreateTestPage();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(
+ new EventHandler<ApplicationUnhandledExceptionEventArgs>(ReportErrorToDOM),
+ new object[] { sender, e } );
+ }
+ }
+ private void ReportErrorToDOM(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs b/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs
index 75580473..65683188 100644
--- a/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs
+++ b/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs
@@ -39,14 +39,14 @@ using System.Collections;
using System.Collections.Generic;
using Google.ProtocolBuffers;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class ExtendableBuilderLiteTest
{
- [Test]
+ [TestMethod]
public void TestHasExtensionT()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -55,14 +55,14 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestHasExtensionTMissing()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder();
Assert.IsFalse(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestGetExtensionCountT()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -73,14 +73,14 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(3, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestGetExtensionCountTEmpty()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder();
Assert.AreEqual(0, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestGetExtensionTNull()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder();
@@ -88,7 +88,7 @@ namespace Google.ProtocolBuffers
Assert.IsNull(value);
}
- [Test]
+ [TestMethod]
public void TestGetExtensionTValue()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -97,14 +97,14 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(3, builder.GetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestGetExtensionTEmpty()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder();
Assert.AreEqual(0, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite).Count);
}
- [Test]
+ [TestMethod]
public void TestGetExtensionTList()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -116,7 +116,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(3, values.Count);
}
- [Test]
+ [TestMethod]
public void TestGetExtensionTIndex()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -128,14 +128,14 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(i, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, i));
}
- [Test, ExpectedException(typeof (ArgumentOutOfRangeException))]
+ [TestMethod, ExpectedException(typeof (ArgumentOutOfRangeException))]
public void TestGetExtensionTIndexOutOfRange()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder();
builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0);
}
- [Test]
+ [TestMethod]
public void TestSetExtensionTIndex()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -154,14 +154,14 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(5 + i, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, i));
}
- [Test, ExpectedException(typeof (ArgumentOutOfRangeException))]
+ [TestMethod, ExpectedException(typeof (ArgumentOutOfRangeException))]
public void TestSetExtensionTIndexOutOfRange()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder();
builder.SetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0, -1);
}
- [Test]
+ [TestMethod]
public void TestClearExtensionTList()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -172,7 +172,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(0, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestClearExtensionTValue()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -183,7 +183,7 @@ namespace Google.ProtocolBuffers
Assert.IsFalse(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestIndexedByDescriptor()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder();
@@ -195,7 +195,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(123, builder.GetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestIndexedByDescriptorAndOrdinal()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -209,7 +209,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(123, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0));
}
- [Test, ExpectedException(typeof (ArgumentOutOfRangeException))]
+ [TestMethod, ExpectedException(typeof (ArgumentOutOfRangeException))]
public void TestIndexedByDescriptorAndOrdinalOutOfRange()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder();
@@ -219,7 +219,7 @@ namespace Google.ProtocolBuffers
builder[f, 0] = 123;
}
- [Test]
+ [TestMethod]
public void TestClearFieldByDescriptor()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -231,7 +231,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(0, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite));
}
- [Test]
+ [TestMethod]
public void TestAddRepeatedFieldByDescriptor()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -244,7 +244,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(123, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 1));
}
- [Test]
+ [TestMethod]
public void TestMissingExtensionsLite()
{
const int optionalInt32 = 12345678;
@@ -269,7 +269,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(0, copybits.Length);
}
- [Test]
+ [TestMethod]
public void TestMissingFieldsLite()
{
TestAllTypesLite msg = TestAllTypesLite.CreateBuilder()
diff --git a/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs b/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs
index 30e34b93..a7c0f69a 100644
--- a/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs
+++ b/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs
@@ -39,22 +39,23 @@ using System.Collections.Generic;
using System.Text;
using Google.ProtocolBuffers;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class ExtendableMessageLiteTest
{
- [Test, Ignore("Not implemented, no assertion made"), ExpectedException(typeof (ArgumentException))]
- public void ExtensionWriterInvalidExtension()
- {
- TestPackedExtensionsLite.CreateBuilder()[
- UnitTestLiteProtoFile.OptionalForeignMessageExtensionLite.Descriptor] =
- ForeignMessageLite.DefaultInstance;
- }
-
- [Test]
+ //The lite framework does not make this assertion
+ //[TestMethod, Ignore, ExpectedException(typeof (ArgumentException))]
+ //public void ExtensionWriterInvalidExtension()
+ //{
+ // TestPackedExtensionsLite.CreateBuilder()[
+ // UnitTestLiteProtoFile.OptionalForeignMessageExtensionLite.Descriptor] =
+ // ForeignMessageLite.DefaultInstance;
+ //}
+
+ [TestMethod]
public void ExtensionWriterTestMessages()
{
TestAllExtensionsLite.Builder b = TestAllExtensionsLite.CreateBuilder().SetExtension(
@@ -66,10 +67,10 @@ namespace Google.ProtocolBuffers
UnitTestLiteProtoFile.RegisterAllExtensions(registry);
copy = TestAllExtensionsLite.ParseFrom(msg.ToByteArray(), registry);
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void ExtensionWriterIsInitialized()
{
Assert.IsTrue(ForeignMessageLite.DefaultInstance.IsInitialized);
@@ -79,7 +80,7 @@ namespace Google.ProtocolBuffers
.IsInitialized);
}
- [Test]
+ [TestMethod]
public void ExtensionWriterTestSetExtensionLists()
{
TestAllExtensionsLite msg, copy;
@@ -95,13 +96,13 @@ namespace Google.ProtocolBuffers
UnitTestLiteProtoFile.RegisterAllExtensions(registry);
copy = TestAllExtensionsLite.ParseFrom(msg.ToByteArray(), registry);
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_FOO,
copy.GetExtension(UnitTestLiteProtoFile.RepeatedForeignEnumExtensionLite, 1));
}
- [Test]
+ [TestMethod]
public void ExtensionWriterTest()
{
TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder()
@@ -180,7 +181,7 @@ namespace Google.ProtocolBuffers
TestAllExtensionsLite.CreateBuilder().MergeFrom(msg.ToByteArray(), registry);
TestAllExtensionsLite copy = copyBuilder.Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
Assert.AreEqual(true, copy.GetExtension(UnitTestLiteProtoFile.DefaultBoolExtensionLite));
Assert.AreEqual(ByteString.CopyFromUtf8("123"),
@@ -323,7 +324,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.PackedUint64ExtensionLite, 1));
}
- [Test]
+ [TestMethod]
public void ExtensionWriterTestPacked()
{
TestPackedExtensionsLite msg = BuildPackedExtensions();
@@ -335,12 +336,12 @@ namespace Google.ProtocolBuffers
TestPackedExtensionsLite.CreateBuilder().MergeFrom(msg.ToByteArray(), registry);
TestPackedExtensionsLite copy = copyBuilder.Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
AssertPackedExtensions(copy);
}
- [Test]
+ [TestMethod]
public void TestUnpackedAndPackedExtensions()
{
TestPackedExtensionsLite original = BuildPackedExtensions();
@@ -355,18 +356,18 @@ namespace Google.ProtocolBuffers
TestPackedExtensionsLite packed = TestPackedExtensionsLite.ParseFrom(unpacked.ToByteArray(), registry);
Assert.AreEqual(original, packed);
- Assert.AreEqual(original.ToByteArray(), packed.ToByteArray());
+ TestUtil.AssertBytesEqual(original.ToByteArray(), packed.ToByteArray());
AssertPackedExtensions(packed);
}
- [Test]
+ [TestMethod]
public void TestUnpackedFromPackedInput()
{
byte[] packedData = BuildPackedExtensions().ToByteArray();
TestUnpackedTypesLite unpacked = TestUnpackedTypesLite.ParseFrom(packedData);
TestPackedTypesLite packed = TestPackedTypesLite.ParseFrom(unpacked.ToByteArray());
- Assert.AreEqual(packedData, packed.ToByteArray());
+ TestUtil.AssertBytesEqual(packedData, packed.ToByteArray());
unpacked = TestUnpackedTypesLite.ParseFrom(packed.ToByteArray());
diff --git a/src/ProtocolBuffersLite.Test/InteropLiteTest.cs b/src/ProtocolBuffersLite.Test/InteropLiteTest.cs
index c49e0350..37739d2f 100644
--- a/src/ProtocolBuffersLite.Test/InteropLiteTest.cs
+++ b/src/ProtocolBuffersLite.Test/InteropLiteTest.cs
@@ -38,14 +38,14 @@ using System;
using System.Collections.Generic;
using Google.ProtocolBuffers;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class InteropLiteTest
{
- [Test]
+ [TestMethod]
public void TestConvertFromFullMinimal()
{
TestInteropPerson person = TestInteropPerson.CreateBuilder()
@@ -56,10 +56,10 @@ namespace Google.ProtocolBuffers
TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(person.ToByteArray());
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestConvertFromFullComplete()
{
TestInteropPerson person = TestInteropPerson.CreateBuilder()
@@ -82,10 +82,10 @@ namespace Google.ProtocolBuffers
TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(person.ToByteArray(), registry);
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestConvertFromLiteMinimal()
{
TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder()
@@ -96,10 +96,10 @@ namespace Google.ProtocolBuffers
TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray());
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestConvertFromLiteComplete()
{
TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder()
@@ -122,7 +122,7 @@ namespace Google.ProtocolBuffers
TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry);
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
}
public ByteString AllBytes
@@ -136,7 +136,7 @@ namespace Google.ProtocolBuffers
}
}
- [Test]
+ [TestMethod]
public void TestCompareStringValues()
{
TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder()
@@ -147,7 +147,7 @@ namespace Google.ProtocolBuffers
.AddPhone(TestInteropPersonLite.Types.PhoneNumber.CreateBuilder().SetNumber("555-1234").Build())
.AddPhone(
TestInteropPersonLite.Types.PhoneNumber.CreateBuilder().SetNumber(
- System.Text.Encoding.ASCII.GetString(AllBytes.ToByteArray())).Build())
+ System.Text.Encoding.UTF8.GetString(AllBytes.ToByteArray(), 0, AllBytes.Length)).Build())
.AddAddresses(
TestInteropPersonLite.Types.Addresses.CreateBuilder().SetAddress("123 Seseme").SetCity("Wonderland")
.SetState("NA").SetZip(12345).Build())
@@ -161,7 +161,7 @@ namespace Google.ProtocolBuffers
TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry);
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
TestInteropPerson.Builder copyBuilder = TestInteropPerson.CreateBuilder();
TextFormat.Merge(
@@ -169,7 +169,7 @@ namespace Google.ProtocolBuffers
"[protobuf_unittest_extra.employee_id]"), registry, copyBuilder);
copy = copyBuilder.Build();
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
string liteText = person.ToString().TrimEnd().Replace("\r", "");
string fullText = copy.ToString().TrimEnd().Replace("\r", "");
diff --git a/src/ProtocolBuffersLite.Test/LiteTest.cs b/src/ProtocolBuffersLite.Test/LiteTest.cs
index f1cb949a..3561876b 100644
--- a/src/ProtocolBuffersLite.Test/LiteTest.cs
+++ b/src/ProtocolBuffersLite.Test/LiteTest.cs
@@ -39,7 +39,7 @@ using System.Collections.Generic;
using System.IO;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
@@ -47,10 +47,10 @@ namespace Google.ProtocolBuffers
/// Miscellaneous tests for message operations that apply to both
/// generated and dynamic messages.
/// </summary>
- [TestFixture]
+ [TestClass]
public class LiteTest
{
- [Test]
+ [TestMethod]
public void TestLite()
{
// Since lite messages are a subset of regular messages, we can mostly
@@ -79,7 +79,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(7, message2.OptionalNestedMessage.Bb);
}
- [Test]
+ [TestMethod]
public void TestLiteExtensions()
{
// TODO(kenton): Unlike other features of the lite library, extensions are
diff --git a/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs b/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs
index 47014f34..c65cb7f1 100644
--- a/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs
+++ b/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs
@@ -35,16 +35,16 @@
#endregion
using System.IO;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using Google.ProtocolBuffers.TestProtos;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class MissingFieldAndExtensionTest
{
- [Test]
+ [TestMethod]
public void TestRecoverMissingExtensions()
{
const int optionalInt32 = 12345678;
@@ -66,7 +66,7 @@ namespace Google.ProtocolBuffers
//Even though copy does not understand the typees they serialize correctly
byte[] copybits = copy.ToByteArray();
- Assert.AreEqual(bits, copybits);
+ TestUtil.AssertBytesEqual(bits, copybits);
ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
UnitTestProtoFile.RegisterAllExtensions(registry);
@@ -77,20 +77,20 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(3, copy.GetExtensionCount(UnitTestProtoFile.RepeatedDoubleExtension));
Assert.AreEqual(msg, copy);
- Assert.AreEqual(bits, copy.ToByteArray());
+ TestUtil.AssertBytesEqual(bits, copy.ToByteArray());
//If we modify the object this should all continue to work as before
copybits = copy.ToBuilder().Build().ToByteArray();
- Assert.AreEqual(bits, copybits);
+ TestUtil.AssertBytesEqual(bits, copybits);
//If we replace extension the object this should all continue to work as before
copybits = copy.ToBuilder()
.SetExtension(UnitTestProtoFile.OptionalInt32Extension, optionalInt32)
.Build().ToByteArray();
- Assert.AreEqual(bits, copybits);
+ TestUtil.AssertBytesEqual(bits, copybits);
}
- [Test]
+ [TestMethod]
public void TestRecoverMissingFields()
{
TestMissingFieldsA msga = TestMissingFieldsA.CreateBuilder()
@@ -109,7 +109,7 @@ namespace Google.ProtocolBuffers
msgb.UnknownFields[TestMissingFieldsA.EmailFieldNumber].LengthDelimitedList[0].ToStringUtf8());
//serializes exactly the same (at least for this simple example)
- Assert.AreEqual(msga.ToByteArray(), msgb.ToByteArray());
+ TestUtil.AssertBytesEqual(msga.ToByteArray(), msgb.ToByteArray());
Assert.AreEqual(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray()));
//now re-create an exact copy of A from serialized B
@@ -147,7 +147,7 @@ namespace Google.ProtocolBuffers
());
}
- [Test]
+ [TestMethod]
public void TestRecoverMissingMessage()
{
TestMissingFieldsA.Types.SubA suba =
@@ -170,7 +170,7 @@ namespace Google.ProtocolBuffers
());
//serializes exactly the same (at least for this simple example)
- Assert.AreEqual(msga.ToByteArray(), msgb.ToByteArray());
+ TestUtil.AssertBytesEqual(msga.ToByteArray(), msgb.ToByteArray());
Assert.AreEqual(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray()));
//now re-create an exact copy of A from serialized B
@@ -194,7 +194,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual("Name", copya.Name);
Assert.AreEqual(suba, copya.TestA);
Assert.AreEqual(1, copya.UnknownFields.FieldDictionary.Count);
- Assert.AreEqual(subb.ToByteArray(),
+ TestUtil.AssertBytesEqual(subb.ToByteArray(),
copya.UnknownFields[TestMissingFieldsB.TestBFieldNumber].LengthDelimitedList[0].ToByteArray());
//Lastly we can even still trip back to type B and see all fields:
@@ -206,7 +206,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(1, copyb.UnknownFields.FieldDictionary.Count);
}
- [Test]
+ [TestMethod]
public void TestRestoreFromOtherType()
{
TestInteropPerson person = TestInteropPerson.CreateBuilder()
@@ -234,7 +234,7 @@ namespace Google.ProtocolBuffers
TestInteropPerson copy = TestInteropPerson.ParseFrom(temp.ToByteArray(), registry);
Assert.AreEqual(person, copy);
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
}
}
} \ No newline at end of file
diff --git a/src/ProtocolBuffersLite.Test/Properties/AppManifest.xml b/src/ProtocolBuffersLite.Test/Properties/AppManifest.xml
new file mode 100644
index 00000000..a9552327
--- /dev/null
+++ b/src/ProtocolBuffersLite.Test/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test(Silverlight).csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test(Silverlight).csproj
new file mode 100644
index 00000000..b852f233
--- /dev/null
+++ b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test(Silverlight).csproj
@@ -0,0 +1,147 @@
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug_Silverlight</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C56950B0-9F97-4250-8945-4B3C2D441FEA}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers</RootNamespace>
+ <AssemblyName>Google.ProtocolBuffersLite.Test</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>Google.ProtocolBuffersLite.Test.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>Google.ProtocolBuffers.App</SilverlightAppEntry>
+ <TestPageFileName>TestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>false</ValidateXaml>
+ <ThrowErrorsInValidation>false</ThrowErrorsInValidation>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug_Silverlight</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>3021</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release_Silverlight</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>3021</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Silverlight.Testing, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Windows" />
+ <Reference Include="mscorlib" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\ProtocolBuffers.Test\Properties\AssemblyInfo.cs">
+ <Link>Properties\AssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="..\ProtocolBuffers.Test\TestRpcForMimeTypes.cs">
+ <Link>TestRpcForMimeTypes.cs</Link>
+ </Compile>
+ <Compile Include="..\ProtocolBuffers.Test\TestRpcGenerator.cs">
+ <Link>TestRpcGenerator.cs</Link>
+ </Compile>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="AbstractBuilderLiteTest.cs" />
+ <Compile Include="AbstractMessageLiteTest.cs" />
+ <Compile Include="ExtendableBuilderLiteTest.cs" />
+ <Compile Include="ExtendableMessageLiteTest.cs" />
+ <Compile Include="LiteTest.cs" />
+ <Compile Include="SerializableAttribute.cs" />
+ <Compile Include="TestLiteByApi.cs" />
+ <Compile Include="TestProtos\UnitTestExtrasLiteProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestImportLiteProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestLiteProtoFile.cs" />
+ <Compile Include="TestUtil.cs" />
+ <Compile Include="TestProtos\UnitTestRpcInteropLite.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization%28Silverlight%29.csproj">
+ <Project>{B6CDC03B-EBBD-4F38-9F84-736EC0948090}</Project>
+ <Name>ProtocolBuffersLite.Serialization%28Silverlight%29</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffersLite%28Silverlight%29.csproj">
+ <Project>{2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}</Project>
+ <Name>ProtocolBuffersLite%28Silverlight%29</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj
index b846ff1a..d10aac15 100644
--- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj
+++ b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj
@@ -39,9 +39,9 @@
<NoStdLib>true</NoStdLib>
</PropertyGroup>
<ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
+ <Reference Include="nunit.framework">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\NUnit 2.2.8.0\nunit.framework.dll</HintPath>
+ <HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=3.5.0.2, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -53,6 +53,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="..\..\lib\NUnit-config\Microsoft.VisualStudio.TestTools.cs">
+ <Link>Microsoft.VisualStudio.TestTools.cs</Link>
+ </Compile>
<Compile Include="..\ProtocolBuffers.Test\Properties\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
@@ -73,6 +76,7 @@
<Compile Include="TestProtos\UnitTestImportLiteProtoFile.cs" />
<Compile Include="TestProtos\UnitTestLiteProtoFile.cs" />
<Compile Include="TestProtos\UnitTestRpcInteropLite.cs" />
+ <Compile Include="TestUtil.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.csproj">
@@ -93,4 +97,10 @@
<Target Name="AfterBuild">
</Target>
-->
+ <PropertyGroup>
+ <StartAction>Program</StartAction>
+ <StartProgram>$(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe</StartProgram>
+ <StartArguments>/nologo /noshadow /labels /wait $(AssemblyName).dll</StartArguments>
+ <StartWorkingDirectory>$(ProjectDir)$(OutputPath)</StartWorkingDirectory>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test(Silverlight).csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test(Silverlight).csproj
new file mode 100644
index 00000000..424ee70f
--- /dev/null
+++ b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test(Silverlight).csproj
@@ -0,0 +1,142 @@
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug_Silverlight</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{63B8D05E-4581-4B92-B8D5-77E702535C7F}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers</RootNamespace>
+ <AssemblyName>Google.ProtocolBuffersLiteMixed.Test</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>Google.ProtocolBuffersLiteMixed.Test.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>Google.ProtocolBuffers.App</SilverlightAppEntry>
+ <TestPageFileName>TestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>false</ValidateXaml>
+ <ThrowErrorsInValidation>false</ThrowErrorsInValidation>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <SilverlightVersion Condition=" '$(SilverlightVersion)' == '' ">v2.0</SilverlightVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Silverlight|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug_Silverlight</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>3021</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Silverlight|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release_Silverlight</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>3021</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Silverlight.Testing, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Windows" />
+ <Reference Include="mscorlib" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\ProtocolBuffers.Test\Properties\AssemblyInfo.cs">
+ <Link>Properties\AssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="AbstractBuilderLiteTest.cs" />
+ <Compile Include="AbstractMessageLiteTest.cs" />
+ <Compile Include="ExtendableBuilderLiteTest.cs" />
+ <Compile Include="ExtendableMessageLiteTest.cs" />
+ <Compile Include="InteropLiteTest.cs" />
+ <Compile Include="LiteTest.cs" />
+ <Compile Include="MissingFieldAndExtensionTest.cs" />
+ <Compile Include="SerializableAttribute.cs" />
+ <Compile Include="TestLiteByApi.cs" />
+ <Compile Include="TestProtos\UnitTestExtrasFullProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestExtrasLiteProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestImportLiteProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestImportProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestLiteImportNonLiteProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestLiteProtoFile.cs" />
+ <Compile Include="TestProtos\UnitTestProtoFile.cs" />
+ <Compile Include="TestUtil.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers%28Silverlight%29.csproj">
+ <Project>{7E4E681E-5D09-43FB-8D9E-35A454730A85}</Project>
+ <Name>ProtocolBuffers%28Silverlight%29</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj
index d61d6651..b0a2b7c1 100644
--- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj
+++ b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj
@@ -39,9 +39,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
+ <Reference Include="nunit.framework">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\NUnit 2.2.8.0\nunit.framework.dll</HintPath>
+ <HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=3.5.0.2, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -53,6 +53,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="..\..\lib\NUnit-config\Microsoft.VisualStudio.TestTools.cs">
+ <Link>Microsoft.VisualStudio.TestTools.cs</Link>
+ </Compile>
<Compile Include="..\ProtocolBuffers.Test\Properties\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
@@ -71,6 +74,7 @@
<Compile Include="TestProtos\UnitTestLiteImportNonLiteProtoFile.cs" />
<Compile Include="TestProtos\UnitTestLiteProtoFile.cs" />
<Compile Include="TestProtos\UnitTestProtoFile.cs" />
+ <Compile Include="TestUtil.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
@@ -86,4 +90,10 @@
<Target Name="AfterBuild">
</Target>
-->
+ <PropertyGroup>
+ <StartAction>Program</StartAction>
+ <StartProgram>$(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe</StartProgram>
+ <StartArguments>/nologo /noshadow /labels /wait $(AssemblyName).dll</StartArguments>
+ <StartWorkingDirectory>$(ProjectDir)$(OutputPath)</StartWorkingDirectory>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffersLite.Test/SerializableAttribute.cs b/src/ProtocolBuffersLite.Test/SerializableAttribute.cs
new file mode 100644
index 00000000..04fcdcba
--- /dev/null
+++ b/src/ProtocolBuffersLite.Test/SerializableAttribute.cs
@@ -0,0 +1,12 @@
+#if SILVERLIGHT
+
+namespace System
+{
+ [AttributeUsage(AttributeTargets.Class)]
+ public class SerializableAttribute : Attribute
+ {
+ public SerializableAttribute () : base() { }
+ }
+}
+
+#endif
diff --git a/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs b/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs
index 7c12ef40..a688a909 100644
--- a/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs
+++ b/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs
@@ -5,11 +5,11 @@ using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class SerializableLiteTest
{
/// <summary>
@@ -18,7 +18,7 @@ namespace Google.ProtocolBuffers
public static readonly ISerializable CompileTimeCheckSerializableMessage = TestRequiredLite.DefaultInstance;
public static readonly ISerializable CompileTimeCheckSerializableBuilder = new TestRequiredLite.Builder();
- [Test]
+ [TestMethod]
public void TestPlainMessage()
{
TestRequiredLite message = TestRequiredLite.CreateBuilder()
@@ -34,7 +34,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(message, copy);
}
- [Test]
+ [TestMethod]
public void TestPlainBuilder()
{
TestRequiredLite.Builder builder = TestRequiredLite.CreateBuilder()
diff --git a/src/ProtocolBuffersLite.Test/TestLiteByApi.cs b/src/ProtocolBuffersLite.Test/TestLiteByApi.cs
index 5fee2ecb..ce373028 100644
--- a/src/ProtocolBuffersLite.Test/TestLiteByApi.cs
+++ b/src/ProtocolBuffersLite.Test/TestLiteByApi.cs
@@ -35,14 +35,14 @@
#endregion
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class TestLiteByApi
{
- [Test]
+ [TestMethod]
public void TestAllTypesEquality()
{
TestAllTypesLite msg = TestAllTypesLite.DefaultInstance;
@@ -57,7 +57,7 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(msg.Equals(copy));
}
- [Test]
+ [TestMethod]
public void TestEqualityOnExtensions()
{
TestAllExtensionsLite msg = TestAllExtensionsLite.DefaultInstance;
@@ -72,13 +72,13 @@ namespace Google.ProtocolBuffers
Assert.IsTrue(msg.Equals(copy));
}
- [Test]
+ [TestMethod]
public void TestAllTypesToString()
{
TestAllTypesLite msg = TestAllTypesLite.DefaultInstance;
TestAllTypesLite copy = msg.ToBuilder().Build();
Assert.AreEqual(msg.ToString(), copy.ToString());
- Assert.IsEmpty(msg.ToString());
+ Assert.AreEqual(0, msg.ToString().Length);
msg = msg.ToBuilder().SetOptionalInt32(-1).Build();
Assert.AreEqual("optional_int32: -1", msg.ToString().TrimEnd());
msg = msg.ToBuilder().SetOptionalString("abc123").Build();
@@ -86,16 +86,16 @@ namespace Google.ProtocolBuffers
msg.ToString().Replace("\r", "").TrimEnd());
}
- [Test]
+ [TestMethod]
public void TestAllTypesDefaultedRoundTrip()
{
TestAllTypesLite msg = TestAllTypesLite.DefaultInstance;
Assert.IsTrue(msg.IsInitialized);
TestAllTypesLite copy = TestAllTypesLite.CreateBuilder().MergeFrom(msg.ToByteArray()).Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestAllTypesModifiedRoundTrip()
{
TestAllTypesLite msg = TestAllTypesLite.DefaultInstance;
@@ -115,7 +115,7 @@ namespace Google.ProtocolBuffers
.AddRepeatedGroup(TestAllTypesLite.Types.RepeatedGroup.CreateBuilder().SetA('A').Build())
;
TestAllTypesLite copy = TestAllTypesLite.CreateBuilder().MergeFrom(msg.ToByteArray()).Build();
- Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
}
}
} \ No newline at end of file
diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs
index 25f48840..535f21e6 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs
@@ -1319,7 +1319,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public SearchService(pb::IRpcDispatch dispatch) : this(dispatch, true) {
}
public SearchService(pb::IRpcDispatch dispatch, bool dispose) {
- if (null == (this.dispatch = dispatch)) throw new global::System.ArgumentNullException();
+ pb::ThrowHelper.ThrowIfNull(this.dispatch = dispatch, "dispatch");
this.dispose = dispose && dispatch is global::System.IDisposable;
}
@@ -1349,7 +1349,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public Dispatch(ISearchService implementation) : this(implementation, true) {
}
public Dispatch(ISearchService implementation, bool dispose) {
- if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException();
+ pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation");
this.dispose = dispose && implementation is global::System.IDisposable;
}
@@ -1363,7 +1363,7 @@ namespace Google.ProtocolBuffers.TestProtos {
switch(methodName) {
case "Search": return response.MergeFrom(implementation.Search((global::Google.ProtocolBuffers.TestProtos.SearchRequest)request)).Build();
case "RefineSearch": return response.MergeFrom(implementation.RefineSearch((global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest)request)).Build();
- default: throw new global::System.MissingMethodException(typeof(ISearchService).FullName, methodName);
+ default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName);
}
}
}
@@ -1381,7 +1381,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public ServerStub(pb::IRpcDispatch implementation) : this(implementation, true) {
}
public ServerStub(pb::IRpcDispatch implementation, bool dispose) {
- if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException();
+ pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation");
this.dispose = dispose && implementation is global::System.IDisposable;
}
@@ -1393,7 +1393,7 @@ namespace Google.ProtocolBuffers.TestProtos {
switch(methodName) {
case "Search": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.SearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder());
case "RefineSearch": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder());
- default: throw new global::System.MissingMethodException(typeof(ISearchService).FullName, methodName);
+ default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName);
}
}
}
diff --git a/src/ProtocolBuffersLite.Test/TestUtil.cs b/src/ProtocolBuffersLite.Test/TestUtil.cs
new file mode 100644
index 00000000..44c09b9c
--- /dev/null
+++ b/src/ProtocolBuffersLite.Test/TestUtil.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace Google.ProtocolBuffers
+{
+ class TestUtil
+ {
+ internal static void AssertBytesEqual(byte[] a, byte[] b)
+ {
+ if (a == null || b == null)
+ {
+ Assert.AreEqual<object>(a, b);
+ }
+ else
+ {
+ Assert.AreEqual(a.Length, b.Length, "The byte[] is not of the expected length.");
+
+ for (int i = 0; i < a.Length; i++)
+ {
+ if (a[i] != b[i])
+ {
+ Assert.AreEqual(a[i], b[i], "Byte[] differs at index " + i);
+ }
+ }
+ }
+ }
+
+ }
+}