Example #1
0
        private async Task <string> IdentifyerToSimFinId(string identifyer, IdentifyerType identifyerType, string companyId)
        {
            var getSimId = new GetSimId(_logger);

            switch (identifyerType)
            {
            case IdentifyerType.CompanyName:
                companyId = await getSimId.GetSimIdByCompanyName(identifyer);

                break;

            case IdentifyerType.Ticker:
                companyId = await getSimId.GetSimIdByTicker(identifyer);

                break;

            case IdentifyerType.SimFinId:
                companyId = identifyer;
                break;

            default:
                break;
            }

            return(companyId);
        }
Example #2
0
        public async Task <StatementList> FetchStatementList(string identifyer, IdentifyerType identifyerType = IdentifyerType.SimFinId)
        {
            string companyId = "";

            companyId = await IdentifyerToSimFinId(identifyer, identifyerType, companyId);

            if (string.IsNullOrEmpty(companyId))
            {
                return(null);
            }
            return(await GetListOfStatements(companyId));
        }
        public async Task FetchStatementList_StateUnderTest_ExpectedBehaviorTicker()
        {
            // Arrange
            var            unitUnderTest  = this.CreateListOfStatements();
            string         identifyer     = "BBY";
            IdentifyerType identifyerType = IdentifyerType.Ticker;

            // Act
            var result = await unitUnderTest.FetchStatementList(
                identifyer,
                identifyerType);

            // Assert
            Assert.True(result.Bs.Count != 0);
        }
        public void FactStatementList_RemovePastTTMs_ExpectedBehavior()
        {
            // Arrange
            var            unitUnderTest  = this.CreateListOfStatements();
            string         identifyer     = "71192";
            IdentifyerType identifyerType = IdentifyerType.SimFinId;

            // Act
            var result = unitUnderTest.FetchStatementList(
                identifyer,
                identifyerType).Result;

            if (result != null)
            {
                result = unitUnderTest.RemovePastTTMs(result);
            }
            var bs = result.Bs.FindAll(b => b.Period.Contains("TTM-"));

            //Assert
            Assert.True(bs.Count == 0);
        }