public void TestCopyFrom() { var testSubject = new NamedTradeline("TestCorporation"); testSubject.AddName(KindsOfNames.Group, "Company"); var testSubject2 = new NamedTradeline(testSubject); Assert.AreEqual(testSubject.Name, testSubject2.Name); var groupName = testSubject2.GetName(KindsOfNames.Group); Assert.IsNotNull(groupName); Assert.AreEqual("Company", groupName); }
public void TestToData() { var dt = DateTime.Today; var testSubject = new NamedTradeline("Test Name"); testSubject.AddName(KindsOfNames.Group, "Company"); var cusip = new Cusip().Value; testSubject.AddPositiveValue(dt.AddDays(-360), new Security(cusip, 5000)); testSubject.AddPositiveValue(dt.AddDays(-360), new Pecuniam(500000.0M)); testSubject.Inception = dt.AddDays(-365); testSubject.AddPositiveValue(dt.AddDays(-365), new Pecuniam(800000M)); var testResult = testSubject.ToData(KindsOfTextCase.Kabab); var asJson = JsonConvert.SerializeObject(testResult, Formatting.Indented); Console.WriteLine(asJson); }