Пример #1
0
 public void OneTimeSetUp()
 {
     _testFolderName = "Test_Folder" + Guid.NewGuid();
     _factory        = EnvironmentCheck.FactoryForEnvironment();
     _filesApi       = _factory.Api <IFilesApi>();
     _foldersApi     = _factory.Api <IFoldersApi>();
 }
Пример #2
0
 public void SetUp()
 {
     _apiFactory       = LusidApiFactoryBuilder.Build("secrets.json");
     _instrumentLoader = new InstrumentLoader(_apiFactory);
     _instrumentIds    = _instrumentLoader.LoadInstruments();
     _ordersApi        = _apiFactory.Api <IOrdersApi>();
 }
        public void SetUp()
        {
            _apiFactory = LusidApiFactoryBuilder.Build("secrets.json");

            _instrumentLoader  = new InstrumentLoader(_apiFactory);
            _instrumentIds     = _instrumentLoader.LoadInstruments();
            _testDataUtilities = new TestDataUtilities(_apiFactory.Api <ITransactionPortfoliosApi>());
        }
 public void OneTimeSetUp()
 {
     _testFolderName = "Test_Folder" + Guid.NewGuid();
     _testFolder     = "/" + _testFolderName;
     _factory        = LusidApiFactoryBuilder.Build("secrets.json");
     _filesApi       = _factory.Api <IFilesApi>();
     _foldersApi     = _factory.Api <IFoldersApi>();
 }
        public void SetUp()
        {
            _apiFactory     = LusidApiFactoryBuilder.Build("secrets.json");
            _instrumentsApi = _apiFactory.Api <IInstrumentsApi>();

            EnsurePropertyDefinition("CustomSector");
            SeedInstrumentMaster();
        }
Пример #6
0
        public void SetUp()
        {
            _factory    = EnvironmentCheck.FactoryForEnvironment();
            _foldersApi = _factory.Api <IFoldersApi>();

            _testFolderId = _foldersApi.GetRootFolder(filter: "Name eq 'SDK_Test_Folder'").Values.SingleOrDefault()?.Id;
            var createFolder = new CreateFolder("/", "SDK_Test_Folder");

            _testFolderId ??= _foldersApi.CreateFolder(createFolder).Id;
        }
        public void SetUp()
        {
            //  Initialise the API factory
            _apiFactory = LusidApiFactoryBuilder.Build("secrets.json");

            // Load default instruments which will be used in the tests
            var instrumentsLoader = new InstrumentLoader(_apiFactory);

            _instrumentIds = instrumentsLoader.LoadInstruments().OrderBy(x => x).ToList();
        }
Пример #8
0
        public void SetUp()
        {
            _factory    = LusidApiFactoryBuilder.Build();
            _foldersApi = _factory.Api <IFoldersApi>();

            _testFolderId = _foldersApi.GetRootFolder(filter: "Name eq 'SDK_Test_Folder'").Values.SingleOrDefault()?.Id;
            var createFolder = new CreateFolder("/", "SDK_Test_Folder");

            _testFolderId ??= _foldersApi.CreateFolder(createFolder).Id;
        }
        public void SetUp()
        {
            _apiFactory = LusidApiFactoryBuilder.Build("secrets.json");

            _instrumentLoader  = new InstrumentLoader(_apiFactory);
            _instrumentIds     = _instrumentLoader.LoadInstruments();
            _recipeApi         = _apiFactory.Api <IConfigurationRecipeApi>();
            _testDataUtilities = new TestDataUtilities(
                _apiFactory.Api <ITransactionPortfoliosApi>(),
                _apiFactory.Api <IInstrumentsApi>(),
                _apiFactory.Api <IQuotesApi>(),
                _apiFactory.Api <IStructuredMarketDataApi>());
        }
        public void LinuxSocketLeakTest() // See DEV-7152
        {
            ApiConfiguration config = ApiConfigurationBuilder.Build("secrets.json");
            var provider            = new ClientCredentialsFlowTokenProvider(config);

            var api = BuildApi();

            api.CreatePortfolioGroup("sdktest", new CreatePortfolioGroupRequest("TestGroup", displayName: "TestGroup"));

            // This loop should eventually throw a SocketException: "Address already in use" once all the sockets have been exhausted
            for (int i = 0; i < 50_000; i++)
            {
                api = BuildApi();
                PortfolioGroup result = api.GetPortfolioGroup("sdktest", "TestGroup");
                Assert.That(result, Is.Not.Null);

                // Option 1: force dispose of ApiClient
                //api.Configuration.ApiClient.Dispose();

                // Option 2: force all finalizers to run
                if (i % 100 == 0)
                {
                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                }
            }

            /*** Local Functions ***/
            IPortfolioGroupsApi BuildApi()
            {
                // An instance of HttpClient is created within LusidApiFactory.Configuration.ApiClient.RestClient
                // which wasn't being disposed
                ILusidApiFactory    factory = LusidApiFactoryBuilder.Build(config.ApiUrl, provider);
                IPortfolioGroupsApi api     = factory.Api <IPortfolioGroupsApi>();

                return(api);
            }
        }
Пример #11
0
 public void SetUp()
 {
     _apiFactory = LusidApiFactoryBuilder.Build("secrets.json");
 }
Пример #12
0
 public InstrumentLoader(ILusidApiFactory apiFactory)
 {
     _apiFactory = apiFactory ?? throw new ArgumentNullException(nameof(apiFactory));
 }
 public void SetUp()
 {
     _factory = LusidApiFactoryBuilder.Build();
 }
Пример #14
0
 public void SetUp()
 {
     _factory = EnvironmentCheck.FactoryForEnvironment();
 }
 public void SetUp()
 {
     _factory              = EnvironmentCheck.FactoryForEnvironment();
     _foldersApi           = _factory.Api <IFoldersApi>();
     _foldersApiExtensions = new FoldersApiExtensions(_foldersApi);
 }