Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'pool' of /media/SCORDER2G/mongodb-csharp into pool
Browse files Browse the repository at this point in the history
Conflicts:
	MongoDB.Net-Tests/TestCollection.cs
  • Loading branch information
samus committed Mar 12, 2010
2 parents c9779cf + e9661ea commit 8d03b26
Show file tree
Hide file tree
Showing 16 changed files with 851 additions and 729 deletions.
86 changes: 43 additions & 43 deletions MongoDB.Driver.Benchmark/MongoDB.Driver.Benchmark.csproj
@@ -1,44 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5ACD68A0-0F2E-452A-90E3-3D1CB82C055B}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>MongoDB.Driver.Benchmark</RootNamespace>
<AssemblyName>MongoDB.Driver.Benchmark</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MongoDBDriver\MongoDB.Driver.csproj">
<Project>{B125BBA6-BFFD-44FA-9254-9B1754CD8AF3}</Project>
<Name>MongoDB.Driver</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5ACD68A0-0F2E-452A-90E3-3D1CB82C055B}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>MongoDB.Driver.Benchmark</RootNamespace>
<AssemblyName>MongoDB.Driver.Benchmark</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MongoDBDriver\MongoDB.Driver.csproj">
<Project>{B125BBA6-BFFD-44FA-9254-9B1754CD8AF3}</Project>
<Name>MongoDB.Driver</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
126 changes: 61 additions & 65 deletions MongoDB.GridFS.Tests/MongoDB.GridFS.Tests.csproj
@@ -1,66 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0C293FE9-F670-4FEF-A60F-20F8C978B1CD}</ProjectGuid>
<OutputType>Library</OutputType>
<AssemblyName>MongoDB.GridFS.Tests</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<RootNamespace>MongoDB.GridFS.Tests</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework, Version=2.4.3.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\redist\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="GridFileInfoTest.cs" />
<Compile Include="GridFileStreamTest.cs" />
<Compile Include="GridFileTest.cs" />
<Compile Include="GridTestBase.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MongoDBDriver\MongoDB.Driver.csproj">
<Project>{B125BBA6-BFFD-44FA-9254-9B1754CD8AF3}</Project>
<Name>MongoDB.Driver</Name>
</ProjectReference>
<ProjectReference Include="..\MongoDB.GridFS\MongoDB.GridFS.csproj">
<Project>{B42DBBF9-0A1F-4749-9787-013BF8D8F435}</Project>
<Name>MongoDB.GridFS</Name>
</ProjectReference>
<ProjectReference Include="..\MongoDB.Net-Tests\MongoDB.Driver.Tests.csproj">
<Project>{C8BC95AB-25C6-4133-BC9F-8B6BB782CA02}</Project>
<Name>MongoDB.Driver.Tests</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<None Include="MongoDB.GridFS.Tests.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0C293FE9-F670-4FEF-A60F-20F8C978B1CD}</ProjectGuid>
<OutputType>Library</OutputType>
<AssemblyName>MongoDB.GridFS.Tests</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<RootNamespace>MongoDB.GridFS.Tests</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework, Version=2.4.3.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\redist\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="GridFileInfoTest.cs" />
<Compile Include="GridFileStreamTest.cs" />
<Compile Include="GridFileTest.cs" />
<Compile Include="GridTestBase.cs" />
<None Include="MongoDB.GridFS.Tests.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MongoDB.Net-Tests\MongoDB.Driver.Tests.csproj">
<Project>{C8BC95AB-25C6-4133-BC9F-8B6BB782CA02}</Project>
<Name>MongoDB.Driver.Tests</Name>
</ProjectReference>
<ProjectReference Include="..\MongoDBDriver\MongoDB.Driver.csproj">
<Project>{B125BBA6-BFFD-44FA-9254-9B1754CD8AF3}</Project>
<Name>MongoDB.Driver</Name>
</ProjectReference>
<ProjectReference Include="..\MongoDB.GridFS\MongoDB.GridFS.csproj">
<Project>{B42DBBF9-0A1F-4749-9787-013BF8D8F435}</Project>
<Name>MongoDB.GridFS</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
100 changes: 52 additions & 48 deletions MongoDB.GridFS/MongoDB.GridFS.csproj
@@ -1,49 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B42DBBF9-0A1F-4749-9787-013BF8D8F435}</ProjectGuid>
<OutputType>Library</OutputType>
<AssemblyName>MongoDB.GridFS</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<RootNamespace>MongoDB.GridFS</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="GridFile.cs" />
<Compile Include="GridFileInfo.cs" />
<Compile Include="GridFileStream.cs" />
<Compile Include="GridException.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MongoDBDriver\MongoDB.Driver.csproj">
<Project>{B125BBA6-BFFD-44FA-9254-9B1754CD8AF3}</Project>
<Name>MongoDB.Driver</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B42DBBF9-0A1F-4749-9787-013BF8D8F435}</ProjectGuid>
<OutputType>Library</OutputType>
<AssemblyName>MongoDB.GridFS</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<RootNamespace>MongoDB.GridFS</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="GridFile.cs" />
<Compile Include="GridFileInfo.cs" />
<Compile Include="GridFileStream.cs" />
<Compile Include="GridException.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MongoDBDriver\MongoDB.Driver.csproj">
<Project>{B125BBA6-BFFD-44FA-9254-9B1754CD8AF3}</Project>
<Name>MongoDB.Driver</Name>
</ProjectReference>
<ProjectReference Include="..\MongoDB.Net-Tests\MongoDB.Driver.Tests.csproj">
<Project>{C8BC95AB-25C6-4133-BC9F-8B6BB782CA02}</Project>
<Name>MongoDB.Driver.Tests</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
21 changes: 20 additions & 1 deletion MongoDB.Net-Tests/Bson/TestBsonWriter.cs
Expand Up @@ -87,7 +87,7 @@ public class TestBsonWriter
}

[Test]
public void TestNullsDontThrowExceptionsExceptions(){
public void TestNullsDontThrowExceptions(){
MemoryStream ms = new MemoryStream();
BsonWriter writer = new BsonWriter(ms);
Document doc = new Document().Append("n", null);
Expand All @@ -97,5 +97,24 @@ public class TestBsonWriter
Assert.Fail("Null Reference Exception was thrown on trying to serialize a null value");
}
}

[Test]
public void TestWritingTooLargeDocument(){
MemoryStream ms = new MemoryStream();
BsonWriter writer = new BsonWriter(ms);
Binary b = new Binary(new byte[BsonInfo.MaxDocumentSize]);
Document big = new Document().Append("x", b);
bool thrown = false;
try{
writer.Write(big);
}catch(ArgumentException){
thrown = true;
}catch(Exception e){
Assert.Fail("Wrong Exception thrown " + e.GetType().Name);
}

Assert.IsTrue(thrown, "Shouldn't be able to write large document");
}

}
}

0 comments on commit 8d03b26

Please sign in to comment.