/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <string> UserGetLastActivityAsync(this IAPIClient operations, System.Guid?id = default(System.Guid?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UserGetLastActivityWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='email'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <UserDetailModelInner> UserGetByEmailAsync(this IAPIClient operations, string email = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UserGetByEmailWithHttpMessagesAsync(email, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <UserListModelInner> > UsersNotInTeamAsync(this IAPIClient operations, System.Guid?id = default(System.Guid?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UsersNotInTeamWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='name'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <bool?> TeamExistsAsync(this IAPIClient operations, string name = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.TeamExistsWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='user'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <UserDetailModelInner> UserCreateAsync(this IAPIClient operations, UserDetailModelInner user = default(UserDetailModelInner), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UserCreateWithHttpMessagesAsync(user, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='substring'> /// </param> /// <param name='id'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <System.Guid?> > SearchInPostsAsync(this IAPIClient operations, string substring = default(string), System.Guid?id = default(System.Guid?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.SearchInPostsWithHttpMessagesAsync(substring, id, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='team'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <TeamDetailModelInner> CreateTeamAsync(this IAPIClient operations, TeamDetailModelInner team = default(TeamDetailModelInner), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateTeamWithHttpMessagesAsync(team, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public FriendsController(ILogger <FriendsController> logger, IIdentityClient client, IConfiguration Configuration, IAPIClient taskClient) { _client = client; _logger = logger; this.Configuration = Configuration; _taskClient = taskClient; }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RecipeModelInner> RecipesGetItemAsync(this IAPIClient operations, System.Guid?id = default(System.Guid?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RecipesGetItemWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public MyTaskController(ILogger <MyTaskController> logger, IAPIClient client, IMyTaskFilterService filterService, IIdentityClient identityClient) { _client = client; _logger = logger; _filterService = filterService; _identityClient = identityClient; }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <RecipeModelInner> > RecipesGetAllItemsAsync(this IAPIClient operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RecipesGetAllItemsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public void Setup() { _listingsForTraining = new List <SoldListing>(); var apiClientMock = new Mock <IAPIClient>(); _client = apiClientMock.Object; }
public StudentsController(IAPIClient <Student> apiClient, IAPIClient <Course> apiClientCourse, IAPIClient <Address> apiAddressCourse) { _apiClientStudent = apiClient; _apiClientCourse = apiClientCourse; _apiClientAddress = apiAddressCourse; selectCourses = new SelectList(_apiClientCourse.GetListFromAPI("api/Course").GetAwaiter().GetResult(), "Id", "Name");; }
public IndexModel(IAPIClient apiClient, SignInManager <User> signInManager, ILogger <IndexModel> logger, UserManager <User> userManager) { this._apiClient = apiClient; this._signInManager = signInManager; this._logger = logger; this._userManager = userManager; }
public CustomerProxyRepository(IAppSettings appSettings, IAPIClient apiClient) { _appSettings = appSettings; _apiClient = apiClient; //_appSettings.CustomerServiceAPI.BaseUrl = "http://main-api/"; //_appSettings.CustomerServiceAPI.GetCustomers = "api/customers"; //_appSettings.CustomerServiceAPI.GetCustomerByID = "api/customers/{0}"; }
public void EmployeeMonthsWorked_EmployeeWithNoShifts_ReturnsEmptyList() { client = new MockApiClient(shifts, employees, null); controller = new WorkingTimeController(client); var result = controller.EmployeeMonthsWorked(3); var viewResult = Assert.IsType <PartialViewResult>(result); var model = Assert.IsAssignableFrom <MonthYearViewModel>(viewResult.ViewData.Model); Assert.Empty(model.EmployeeMonths); }
public void EmployeeShiftsInMonth_EmployeeWithNoShifts_ReturnsViewModel_CalculatesTotalHours() { // pass no shift data to the mock client - test without shifts client = new MockApiClient(null, employees, null); controller = new WorkingTimeController(client); var result = controller.EmployeeShiftsInMonth(1, null); var viewResult = Assert.IsType <PartialViewResult>(result); Assert.Null(viewResult.ViewData.Model); }
public void Index_ReturnsAViewResult_WithListOfEmployees() { client = new MockApiClient(shifts, employees, months); controller = new WorkingTimeController(client); var result = controller.Index(); var viewResult = Assert.IsType <ViewResult>(result); var model = Assert.IsAssignableFrom <EmployeeViewModel>(viewResult.ViewData.Model); Assert.Equal(6, model.Employees.Count()); }
public void EmployeeMonthsWorked_EmployeeWithShifts_ReturnsListOfMonths() { client = new MockApiClient(shifts, employees, months); controller = new WorkingTimeController(client); var result = controller.EmployeeMonthsWorked(1); // dummy data contains 2 months var viewResult = Assert.IsType <PartialViewResult>(result); var model = Assert.IsAssignableFrom <MonthYearViewModel>(viewResult.ViewData.Model); Assert.Equal(2, model.EmployeeMonths.Count()); }
public IAPIClient Create(string apiType) { IAPIClient _client = null; if (apiType == "Flicker") { _client = new FlickrAPIClient(); } else if (apiType == "Twitter") { } return(_client); }
public void EmployeeShiftsInMonth_EmployeeWithShifts_ReturnsViewModel_CalculatesTotalHours() { client = new MockApiClient(shifts, employees, months); controller = new WorkingTimeController(client); var result = controller.EmployeeShiftsInMonth(1, "11/2016"); // test data includes 4 shifts (3x 9-17, 1x 10-14) - total hours = 28 var viewResult = Assert.IsType <PartialViewResult>(result); var model = Assert.IsAssignableFrom <EmployeeShiftViewModel>(viewResult.ViewData.Model); Assert.Equal(4, model.ShiftsForMonth.Count()); Assert.Equal(28, model.TotalHours); }
static void Main(string[] args) { // The following values which needed to be populated in the App.Config file will need to be provided by Inform Billing baseUrl = ConfigurationManager.AppSettings["InformBillingAPIBaseUrl"]; tokenAccessEndPoint = ConfigurationManager.AppSettings["TokenAccessEndPoint"]; clientId = ConfigurationManager.AppSettings["ClientId"]; apiKey = ConfigurationManager.AppSettings["APIKey"]; customerAPIKey = ConfigurationManager.AppSettings["CustomerAPIKey"]; getCustomerEndPoint = ConfigurationManager.AppSettings["GetCustomerByIdEndPoint"]; // Best to use Dependency Injection here but keeping it simple for this example. sampleAPIClient = new SampleAPIClient(baseUrl, tokenAccessEndPoint, clientId, apiKey, customerAPIKey, new TimeSpan(0, 5, 0)); // Call EndPoint CallGetEndPoint(); Console.ReadLine(); }
public BasePage(IAPIClient client) { this.Client = client; }
public MainWindowPage(IAPIClient client) : base(client) { }
public static async Task RecipesInsertItemAsync(this IAPIClient operations, RecipeModelInner recipe, CancellationToken cancellationToken = default) { await operations.RecipesInsertItemAsync(recipe.Name, recipe.Description, recipe.FoodType.ToString(), recipe.Id, cancellationToken); }
public HomeScreenViewModel(IAPIClient apiClient) { _apiClient = apiClient; ShowWeatherCommand = new MvxCommand(async() => await ExecuteFindWeatherCommand()); }
public LoginArguments(IAPIClient cl, string username) : base(cl) { this.Username = username; }
public virtual void OnSocketReceive(IAPIClient client, dynamic obj) { }
public SocketReceiveArguments(IAPIClient cl, dynamic rec) : base(cl) { this.Received = rec; }
public TPlusRepository(BaseAPIConfig config) { _Client = new TPlusClient(config); }
public PredictionsPage(IAPIClient client) : base(client) { }
public PessoasController(IPessoaService PessoaService, IAPIClient outraAPIClient) { _outraAPIClient = outraAPIClient; _personService = PessoaService; }
/// <summary> /// Tries to invoke the matching routes /// </summary> /// <param name="routeName"></param> /// <param name="client"></param> /// <returns>True if a route has been found matching routeName, false otherwise.</returns> public static bool TryFireRoute(string routeName, IAPIClient client) { if (string.IsNullOrEmpty(routeName)) { return false; } if (routeName.StartsWith("/")) { routeName = routeName.Remove(0, 1); } List<Route> routes = RouteManager.GetMatchingRoutes(routeName); if (routes.Count == 0) { APIServer.Log.Error("Couldn't find any routes with routename '" + routeName + "'"); return false; } foreach (Route route in routes) { APIServer.Log.Info(route.Name + " route found matching '" + routeName + "'!"); var properties = new ExpandoObject() as IDictionary<string, Object>; int i = 0; foreach (string strSegment in routeName.Split('/')) { RouteSegment segment = route.Segments[i]; if (segment.IsProperty) { properties.Add(segment.Name, strSegment); APIServer.Log.Info(segment.Name + " = " + strSegment); } i += 1; } RouteResult result = new RouteResult(); result.Client = client; result.Route = route; result.Properties = properties; foreach (Action<RouteResult> routeResult in route.Results) { routeResult.Invoke(result); } } return true; }
public MoviesService(IAPIClient apiClient, MovieSettings movieSettings) { _movieSettings = movieSettings; _apiClient = apiClient; }
public PacketOut(IAPIClient c) { Client = c; Bytes = new byte[1]; }
public FinancePageModel(IAPIClient apiClient) { _apiClient = apiClient; }
public HelloWorldPage(IAPIClient client) : base(client) { }
public static void RecipesInsertItem(this IAPIClient operations, RecipeModelInner recipe) { operations.RecipesInsertItem(recipe.Name, recipe.Description, recipe.FoodType.ToString(), recipe.Id); }
public PacketJSON(IAPIClient client, string json) : base(client) { WriteInt(json.Length); WriteString(json); }
public DeveloperService(IRepository <Developer> repository, IAPIClient apiClient) { _repository = repository; _apiClient = apiClient; }
public ClientArguments(IAPIClient cl) { this.Client = cl; }