public void TrapOutsideFaultScope() { Exception e; object o; Assert.False(FaultDispatcher.Trap(out e, out o)); }
public InnerClass() { Exception a; object b; Assert.True(FaultDispatcher.Trap(out a, out b) == true); }
public void DoublyNestedClassTest() { Exception a; object b; Assert.True(FaultDispatcher.Trap(out a, out b)); }
private bool TesteeTriggerOnNthCallBy() { Exception a; object b; return(FaultDispatcher.Trap(out a, out b)); }
public void ThrowCustomExceptionTest() { Exception a; object b; FaultDispatcher.Trap(out a, out b); Assert.IsType(typeof(CustomizedException), a); }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045")] //ref obj parameter public void TestMethod(out Int32[][] intArray, ref object obj, TestEnum[,,] testEnum, NestedClass[][] nestedClass, params int[] intArray2) { intArray = null; Exception a; object b; Assert.True(FaultDispatcher.Trap(out a, out b) == true); }
public void ThrowBuiltInExceptionTest() { Exception a; object b; FaultDispatcher.Trap(out a, out b); Assert.IsType(typeof(ApplicationException), a); }
private void TargetMethodTwoGenericParams <T_first, T_second>(T_first t1, T_second t2) { Exception e; object o; bool ret = FaultDispatcher.Trap(out e, out o); AssertTrapSuccess(ret, e, o); }
public void TargetMethod() { Exception e; object o; bool ret = FaultDispatcher.Trap(out e, out o); AssertTrapSuccess(ret, e, o); }
private void TargetMethodJaggedArrayParam(int[][] i) { Exception e; object o; bool ret = FaultDispatcher.Trap(out e, out o); AssertTrapSuccess(ret, e, o); }
private void TargetMethodOneGenericParam <T>(T t) { Exception e; object o; bool ret = FaultDispatcher.Trap(out e, out o); AssertTrapSuccess(ret, e, o); }
private void TargetMethodNoParams() { Exception e; object o; bool ret = FaultDispatcher.Trap(out e, out o); AssertTrapSuccess(ret, e, o); }
private void TargetMethodOutParam(out int i) { i = 0; Exception e; object o; bool ret = FaultDispatcher.Trap(out e, out o); AssertTrapSuccess(ret, e, o); }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1720")] //Bool in name public bool ReturnBoolTargetMethod(string str, Int32 number) { Exception a; object b; Assert.True(FaultDispatcher.Trap(out a, out b)); Assert.Null(a); return((bool)b); }
public TargetNestedClassGeneric(bool doTrap) { if (doTrap) { Exception e; object o; bool ret = FaultDispatcher.Trap(out e, out o); AssertTrapSuccess(ret, e, o); } }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045")] //ref obj parameter public void TestMethod(out Int32[][] intArray, ref object obj, TestEnum[,,] testEnum, NestedClass[][] nestedClass, params int[] intArray2) { intArray = null; Exception a; object b; // BUG: The code below used to Assert than FD.Trap returns true. // In the latest version of TestApi (which uses xUnit 1.5), this changed. We have // confirmed that the FI functionality works as expected, so we are capturing this fault // as current expected behavior for AppCompat reasons. Assert.True(FaultDispatcher.Trap(out a, out b) == false); }
public bool Update(IMongoQuery query, IMongoUpdate update, UpdateFlags flags) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { return(HandleFaultEvent <bool>(MongoRepositoryHelper.Method.UPDATE_CAS, a, b)); } return(this.repository.Update(query, update, flags)); }
public T Single(Expression <Func <T, bool> > criteria) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { return(HandleFaultEvent <T>(MongoRepositoryHelper.Method.SINGLE, a, b)); } return(this.repository.Single(criteria)); }
public T Add(T entity) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { return(HandleFaultEvent <T>(MongoRepositoryHelper.Method.ADD, a, b)); } return(this.repository.Add(entity)); }
private void PerformanceActionWithTrap() { for (int i = 0; i < 10; i++) { Exception e; Object o; bool trapped = FaultDispatcher.Trap(out e, out o); // This is not strictly needed, but it safeguards the test from succeeding // when it should fail Assert.Equal(FaultScope.Current != null, trapped); } }
public void Add(IEnumerable <T> entities) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { if (a != null) { throw a; } } this.repository.Add(entities); }
public void RemoveAll() { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { if (a != null) { throw a; } } this.repository.RemoveAll(); }
public void ReturnNullTest() { Exception a; object b; Assert.True(FaultDispatcher.Trap(out a, out b)); if (a != null) { throw a; } else { return; } }
public MongoCursor <T> FindAs(IMongoQuery query) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { if (b != null) { b = new TestMongoCursor <T>((IEnumerable <T>)b); } return(HandleFaultEvent <MongoCursor <T> >(MongoRepositoryHelper.Method.FIND_AS, a, b)); } return(this.repository.FindAs(query)); }
public bool Delete(T entity) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { if (a != null) { throw a; } return((bool)b); } return(this.repository.Delete(entity)); }
public IQueryable <T> All(int page, int pageSize) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { if (a != null) { throw a; } return(new EnumerableQuery <T>((IEnumerable <T>)b)); } return(this.repository.All(page, pageSize)); }
public long Delete(IMongoQuery query) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { if (a != null) { throw a; } return((long)b); } return(this.repository.Delete(query)); }
public T FindAndRemove(IMongoQuery query, IMongoSortBy sortBy) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { if (a != null) { throw a; } return((T)b); } return(this.repository.FindAndRemove(query, sortBy)); }
public IQueryable <T> All(Expression <Func <T, bool> > criteria) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { if (a != null) { throw a; } return(new EnumerableQuery <T>((IEnumerable <T>)b)); } return(this.repository.All(criteria)); }
public T FindAndModify(IMongoQuery query, IMongoSortBy sortBy, IMongoUpdate update, bool returnNew, bool upsert) { Exception a; object b; if (FaultDispatcher.Trap(out a, out b)) { if (a != null) { throw a; } return((T)b); } return(this.repository.FindAndModify(query, sortBy, update, returnNew, upsert)); }