anchor.diff:  ///Operators on Expr and Expr<'a> for performing unit test assertions.
   module Swensen.Unquote.Assertions
   open Swensen.Unquote
  +open Swensen.Utils
   
   open System
   open System.Reflection
  
positive.code:     open System.Reflection
  
      type private testFramework =
          | Xunit
          | Nunit
          | Fuchu
  
      ///raise is not inlined in Core.Operators, so shows up in stack traces.  We inline it here for clean stacktraces.
      let inline raise (e: System.Exception) = (# "throw" e : 'U #)
  
negative.code:         
              printfn ""
  
          //determine the method of output (we use seq expression for short circuit selection).
          //order is deliberate to allow use of Fuchu within FSI, but to avoid binding and using GAC installed NUnit within FSI
          let framework = 
              seq { 
                  let assemblies = System.AppDomain.CurrentDomain.GetAssemblies()
                  if assemblies |> Seq.exists (fun a -> a.GetName().Name = "FSI-ASSEMBLY") then
                      //need to resolve FSI-ASSEMBLY first then test for presence of Fuchu or else we run into MagicAssemblyResolution
                      //issue in vs 2010: http://stackoverflow.com/questions/2024036/strange-fsi-exe-behavior
                      if assemblies |> Seq.exists (fun a -> a.GetName().Name = "Fuchu") then
                          yield Fuchu (Type.GetType("Fuchu.AssertException, Fuchu"))
                      else
                          yield Fsi
  
                  let ty = Type.GetType("Fuchu.AssertException, Fuchu")
                  if ty <> null then
                      yield Fuchu ty
  
                  let ty = Type.GetType("Xunit.Assert, xunit") //xunit v1
                  if ty <> null then
                      yield Xunit ty
  
                  let ty = Type.GetType("Xunit.Assert, xunit.assert") //xunit v2
                  if ty <> null then
                      yield Xunit ty
  
                  let ty = Type.GetType("NUnit.Framework.Assert, nunit.framework")
                  if ty <> null then
                      yield Xunit ty
  
                  yield Generic
              } |> Seq.head
  
          //Note use of Delegate.CreateDelegate for cached reflection: 
          //http://msmvps.com/blogs/jon_skeet/archive/2008/08/09/making-reflection-fly-and-exploring-delegates.aspx
          match framework with
          | Fuchu ty -> 
              (fun (msg : string) -> raise (Activator.CreateInstance(ty, msg) :?> Exception)) |> outputReducedExprsMsg
          | Fsi ->
              fsiTestFailed
          | Xunit ty -> 
              let mi = ty.GetMethod("True", [|typeof<bool>;typeof<string>|])
              let del = Delegate.CreateDelegate(typeof<Action<bool,string>>, mi) :?> (Action<bool,string>)
              (fun msg -> del.Invoke(false,msg)) |> outputReducedExprsMsg
          | Nunit ty -> 
              let mi = ty.GetMethod("Fail", [|typeof<string>|])
              let del = Delegate.CreateDelegate(typeof<Action<string>>, mi) :?> (Action<string>)
              (fun msg -> del.Invoke(msg)) |> outputReducedExprsMsg
          | Generic ->
              outputGenericTestFailedMsg |> outputReducedExprsMsg
  #endif
  
      let inline expectedExnButWrongExnRaisedMsg ty1 ty2 = sprintf "Expected exception of type '%s', but '%s' was raised instead" ty1 ty2
  