Browse files

Skip TestBitmap that only fails in the mono runtime for now.

  • Loading branch information...
1 parent 147d512 commit 2c28e49f9779794b6bb4913e11071ff48df99f28 sridharn committed Mar 12, 2012
Showing with 53 additions and 0 deletions.
  1. +3 −0 DriverOnlineTests/DriverOnlineTests.csproj
  2. +7 −0 DriverOnlineTests/Jira/CSharp355Tests.cs
  3. +43 −0 TestEnvironment.cs
View
3 DriverOnlineTests/DriverOnlineTests.csproj
@@ -79,6 +79,9 @@
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
+ <Compile Include="..\TestEnvironment.cs">
+ <Link>TestEnvironment.cs</Link>
+ </Compile>
<Compile Include="Core\CommandResults\CollectionStatsResultTests.cs" />
<Compile Include="Core\CommandResults\CommandResultTests.cs" />
<Compile Include="Core\CommandResults\DatabaseStatsResultTests.cs" />
View
7 DriverOnlineTests/Jira/CSharp355Tests.cs
@@ -28,6 +28,7 @@
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
+using MongoDB.UnitTests;
namespace MongoDB.DriverOnlineTests.Jira.CSharp355
{
@@ -57,6 +58,12 @@ public void TestFixtureSetup()
[Test]
public void TestBitmap()
{
+ if (TestEnvironment.MonoRuntime)
+ {
+ // this test does not work in Mono. Skipping for the time being
+ // CSHARP-389
+ return;
+ }
var bitmap = new Bitmap(1, 2);
var c = new C { I = bitmap, B = bitmap };
_collection.RemoveAll();
View
43 TestEnvironment.cs
@@ -0,0 +1,43 @@
+/* Copyright 2010-2011 10gen Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+using System;
+
+namespace MongoDB.UnitTests
+{
+ internal class TestEnvironment
+ {
+ private static bool _monoRuntime = false;
+
+ static TestEnvironment()
+ {
+ var type = Type.GetType("Mono.Runtime");
+ if (type != null)
+ {
+ _monoRuntime = true;
+ }
+ }
+
+ /// <summary>
+ /// Check to see if the code is being executed on the Mono runtime as opposed to the normal
+ /// Microsoft .Net runtime
+ /// @returns true if running in Mono
+ /// </summary>
+ internal static bool MonoRuntime
+ {
+ get { return _monoRuntime; }
+ }
+ }
+}

0 comments on commit 2c28e49

Please sign in to comment.