public static IArrangeOrAssert <TSubject, TResult, TVars, TSequence> GivenUsing <TSubject, TResult, TVars, TSequence, TDisposable> ( this IArrange <TSubject, TResult, TVars, TSequence> arrange, Func <ITestContext <TSubject, TResult, TVars, TSequence>, TDisposable> scopeProvider) where TDisposable : IDisposable { return(arrange.GivenUsing(typeof(TDisposable).Name, scopeProvider)); }
public static IArrangeOrAssert <TSubject, TResult, TVars, TSequence> GivenUsing <TSubject, TResult, TVars, TSequence> ( this IArrange <TSubject, TResult, TVars, TSequence> arrange, string text, Action <ITestContext <TSubject, TResult, TVars, TSequence> > setup, Action <ITestContext <TSubject, TResult, TVars, TSequence> > cleanup) { return(arrange.GivenUsing(text, x => new DelegateScope(() => setup(x), () => cleanup(x)))); }
public static IArrangeOrAssert <TSubject, TResult, TVars, TSequence> Given <TSubject, TResult, TVars, TSequence> ( this IArrange <TSubject, TResult, TVars, TSequence> arrange, string text) { var controller = arrange.GetTestController(); controller.AddNotImplementedAction <Arrange>(text); return((IArrangeOrAssert <TSubject, TResult, TVars, TSequence>)arrange); }
public virtual async Task <IEnumerable <IVehicleMakeDTO> > GetPagedListAsync(IArrange arrange) { try { var pagedList = await _repository.GetPagedListAsync(arrange); return(pagedList); } catch (Exception e) { throw e; } }
public static IArrangeOrAssert <TSubject, TResult, TVars, TSequence> GivenUsing <TSubject, TResult, TVars, TSequence, TDisposable> ( this IArrange <TSubject, TResult, TVars, TSequence> arrange, string text, Func <ITestContext <TSubject, TResult, TVars, TSequence>, TDisposable> scopeProvider) where TDisposable : IDisposable { var controller = arrange.GetTestController(); IDisposable scope = null; controller.AddSetupCleanup <Arrange, CleanupCommon>( "Create " + text, x => scope = scopeProvider((ITestContext <TSubject, TResult, TVars, TSequence>)x), "Dispose " + text, x => scope.Dispose()); return((IArrangeOrAssert <TSubject, TResult, TVars, TSequence>)arrange); }
public virtual async Task <IEnumerable <IVehicleMakeDTO> > GetPagedListAsync(IArrange arrange) { try { int pageNumber = (arrange.Page ?? 1); var queryable = _repository.Get <VehicleMake>(); if (!String.IsNullOrEmpty(arrange.SearchString)) { queryable = queryable.Where(c => c.Name.Contains(arrange.SearchString)); } switch (arrange.SortOrder) { case "name_desc": queryable = queryable.OrderByDescending(c => c.Name); break; case "Abrv": queryable = queryable.OrderBy(c => c.Abrv); break; case "abrv_desc": queryable = queryable.OrderByDescending(c => c.Abrv); break; default: queryable = queryable.OrderBy(c => c.Name); break; } var vehicleMakes = await queryable.ToPagedListAsync(pageNumber, arrange.PageSize); var vehicleMakesPaged = vehicleMakes.ToMappedPagedList <VehicleMake, VehicleMakeDTO>(); return(vehicleMakesPaged); } catch (Exception e) { throw e; } }
public static ITestController <TSubject, TResult, TVars, TSequence> GetTestController <TSubject, TResult, TVars, TSequence> ( this IArrange <TSubject, TResult, TVars, TSequence> arrange) { return(arrange.Get <ITestController <TSubject, TResult, TVars, TSequence> >()); }
public void Setup() { _stopWatchMock = new Mock <IStopwatch>(); _pattern = Pattern.Configure.MeasureExecutionTime(_stopWatchMock.Object).New; }
public static IArrangeOrAssert <TSubject, TResult, TVars, TSequence> Given <TSubject, TResult, TVars, TSequence> ( this IArrange <TSubject, TResult, TVars, TSequence> arrange, Arrangement <TSubject, TResult, TVars, TSequence> arrangement) { return(arrange.Given("<Arrangement>", arrangement)); }
public VehicleMakeController(IVehicleMakeService vehicleMakeService, IArrange arrange) { _vehicleMakeService = vehicleMakeService; _arrange = arrange; }
public static IArrangeOrAssert <TSubject, TResult, TVars, TSequence> GivenUsing <TSubject, TResult, TVars, TSequence> ( this IArrange <TSubject, TResult, TVars, TSequence> arrange, Type disposableType) { return(arrange.GivenUsing(disposableType.Name, x => disposableType.CreateInstance <IDisposable>())); }