Exemplo n.º 1
0
        public async Task ItCanGetAssets()
        {
            var request = new AssetListRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret);
            var result  = await AssetsService.GetAssetsAsync(request);

            Assert.IsTrue(result.Data.Count() >= 0);
        }
Exemplo n.º 2
0
        public void StaticRouter_Verify_AssetPost(AssetListRequest expectedRequest, string inCommandLine)
        {
            var router = new StaticCommandLineRouterFixture()
            {
                WithRouteValidator = new RouteRequestValidatorFixture().Mock()
            }.Build();

            var actual = router.GetOne(RoutingMetadata.Value.Values, inCommandLine.Split(' '));

            actual.Should().NotBeNull();
            actual.Should().BeAssignableTo <AssetListRequest>();
            actual.Should().BeEquivalentTo(expectedRequest);
        }
Exemplo n.º 3
0
        public static async Task <ListedResourceResponse <AssetSubset> > GetAssetsAsync(AssetListRequest listRequest)
        {
            var apiRequest = new FortnoxApiClientRequest <ListedResourceResponse <AssetSubset> >(
                HttpMethod.Get,
                listRequest.AccessToken,
                listRequest.ClientSecret,
                ApiEndpoints.Assets
                );

            return(await FortnoxAPIClient.CallAsync(apiRequest));
        }
Exemplo n.º 4
0
        private async Task <List <AssetSubset> > GetAssets()
        {
            var request = new AssetListRequest(connectionSettings.AccessToken, connectionSettings.ClientSecret);

            return((await AssetsService.GetAssetsAsync(request)).Data.ToList());
        }