Code cleanup.
Some checks failed
Build .NET Project / build (push) Has been cancelled

This commit is contained in:
2026-03-24 13:36:11 -04:00
parent 3bf89b97e8
commit 70f9af5934
3 changed files with 23 additions and 0 deletions

View File

@@ -524,6 +524,7 @@ namespace MarketData.DataAccess
try try
{ {
if (null == analystRatings || 0 == analystRatings.Count) return true; if (null == analystRatings || 0 == analystRatings.Count) return true;
analystRatings = new AnalystRatings(analystRatings.DistinctBy(x => new {x.Symbol, x.Date.Date, x.BrokerageFirm}).ToList());
sqlConnection = SqlUtils.CreateMySqlConnection(MainDataSource.Instance.LocateDataSource("market_data")); sqlConnection = SqlUtils.CreateMySqlConnection(MainDataSource.Instance.LocateDataSource("market_data"));
sqlTransaction = sqlConnection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted); sqlTransaction = sqlConnection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);
DeleteAnalystRatings(analystRatings, sqlConnection, sqlTransaction); DeleteAnalystRatings(analystRatings, sqlConnection, sqlTransaction);

View File

@@ -29,21 +29,25 @@ namespace MarketData.MarketDataModel
public CompanyProfile() public CompanyProfile()
{ {
} }
public String Industry public String Industry
{ {
get { return industry; } get { return industry; }
set { industry = value; } set { industry = value; }
} }
public String Sector public String Sector
{ {
get { return sector; } get { return sector; }
set { sector = value; } set { sector = value; }
} }
public String SecurityType public String SecurityType
{ {
get { return securityType;; } get { return securityType;; }
set { securityType = value; } set { securityType = value; }
} }
public bool IsEquity public bool IsEquity
{ {
get get
@@ -51,30 +55,36 @@ namespace MarketData.MarketDataModel
return null!=SecurityType && SecurityType.Equals("EQUITY"); return null!=SecurityType && SecurityType.Equals("EQUITY");
} }
} }
public String CompanyName public String CompanyName
{ {
get{return companyName;} get{return companyName;}
set{companyName=value;} set{companyName=value;}
} }
public String Description public String Description
{ {
get{return description;} get{return description;}
set{description=value;} set{description=value;}
} }
public String Symbol public String Symbol
{ {
get { return symbol; } get { return symbol; }
set { symbol = value; } set { symbol = value; }
} }
public String PricingSource public String PricingSource
{ {
set{pricingSource=value;} set{pricingSource=value;}
} }
public bool CanRollPrevious public bool CanRollPrevious
{ {
get{return canRollPrevious;} get{return canRollPrevious;}
set{canRollPrevious=value;} set{canRollPrevious=value;}
} }
public bool FreezePricing public bool FreezePricing
{ {
get{return freezePricing;} get{return freezePricing;}

View File

@@ -447,6 +447,18 @@ public class MarketDataUnitTestClass
Assert.IsTrue(null != companyProfile); Assert.IsTrue(null != companyProfile);
} }
[TestMethod]
public void GetCompanyProfileMorningStar()
{
String symbol = "AAPL";
String nasdaq = "xnas";
String nyse = "xnys";
CompanyProfile companyProfile = MarketDataHelper.GetCompanyProfileMorningStar(symbol, nasdaq);
if(null==companyProfile)companyProfile = MarketDataHelper.GetCompanyProfileMorningStar(symbol, nyse);
Assert.IsTrue(null != companyProfile);
}
// Test all feeds // Test all feeds
[TestMethod] [TestMethod]
public void HeadlinesRetrieval() public void HeadlinesRetrieval()