コード例 #1
0
        public void Should_Format_Company2()
        {
            using (StreamReader reader = new StreamReader(Path.Combine("IEXResponseText", "Company2.json")))
            {
                string companyJson = reader.ReadToEnd();

                IEXFormatter formatter = new IEXFormatter();
                IexCompany   company   = formatter.FormatCompany(companyJson);

                company.Symbol.Should().Be("AAAU");
                company.Employees.Should().BeNull();
            }
        }
コード例 #2
0
        public void Should_Format_Company()
        {
            using (StreamReader reader = new StreamReader(Path.Combine("IEXResponseText", "Company.json")))
            {
                string companyJson = reader.ReadToEnd();

                IEXFormatter formatter = new IEXFormatter();
                IexCompany   company   = formatter.FormatCompany(companyJson);

                company.Ceo.Should().Be("Timothy Donald Cook");
                company.Tags.Length.Should().Be(2);
                company.Tags[0].Should().Be("Electronic Technology");
                company.Tags[1].Should().Be("Telecommunications Equipment");
                company.Symbol.Should().Be("AAPL");
                company.Employees.Should().Be(132000);
            }
        }