PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/test/NRopes.Tests/AssertExtensions.cs

https://github.com/mingdayfly/NRopes
C# | 16 lines | 14 code | 2 blank | 0 comment | 0 complexity | a96d0bb419fe69c31dd287b060c4cb68 MD5 | raw file
  1. namespace NRopes.Tests {
  2. using System;
  3. using FluentAssertions.Primitives;
  4. using Xunit;
  5. public static class AssertExtensions {
  6. public static void BeSameAs<TSubject, TAssertions>(
  7. this ReferenceTypeAssertions<TSubject, TAssertions> assertions, TSubject obj)
  8. where TAssertions : ReferenceTypeAssertions<TSubject, TAssertions> {
  9. Assert.True(
  10. Object.ReferenceEquals(assertions.Subject, obj),
  11. String.Format("Object not the same.\nExpected: {0}\nActual: {1}", assertions.Subject, obj));
  12. }
  13. }
  14. }