Exemplo n.º 1
0
        public void TestGetPaycheck()
        {
            var amer = new NorthAmerican(NAmerUtil.GetWorkingAdultBirthDate(), Gender.Female);
            var testSubject = new NorthAmericanWealth(amer);
            System.Diagnostics.Debug.WriteLine(string.Join(" ", amer.Age, amer.MaritialStatus, amer.Education, amer.Race));

            var testResult = testSubject.GetYearlyIncome(null,1.0);
            System.Diagnostics.Debug.WriteLine(testResult);
            Assert.IsNotNull(testResult);
            Assert.IsTrue(testResult.Amount > 0.0M);
        }
Exemplo n.º 2
0
        public void TestCreateRandomAmericanOpes()
        {
            var amer = new NorthAmerican(NAmerUtil.GetWorkingAdultBirthDate(), Gender.Female);
            var testSubject = new NorthAmericanWealth(amer);
            System.Diagnostics.Debug.WriteLine(string.Join(" ", amer.Age, amer.MaritialStatus, amer.Education, amer.Race));

            testSubject.CreateRandomAmericanOpes();

            Assert.IsTrue(testSubject.HomeDebt.Any());

            Assert.IsTrue(testSubject.CheckingAccounts.Any());
            Assert.IsTrue(testSubject.SavingAccounts.Any());

            System.Diagnostics.Debug.WriteLine(testSubject.FinancialData.ToString());
        }
Exemplo n.º 3
0
        public void TestGetRandomCcDebt()
        {
            var amer = new NorthAmerican(NAmerUtil.GetWorkingAdultBirthDate(), Gender.Female);
            var testSubject = new NorthAmericanWealth(amer);

            testSubject.AddSingleCcDebt();

            Assert.IsTrue(testSubject.CreditCardDebt.Any());

            var testResult = testSubject.CreditCardDebt.First() as CreditCardAccount;
            Assert.IsNotNull(testResult);

            System.Diagnostics.Debug.WriteLine(testResult.Cc.CardHolderSince);
            System.Diagnostics.Debug.WriteLine(testResult.Max);

            System.Diagnostics.Debug.WriteLine(testResult.TradeLine.Balance.ToString());
        }
Exemplo n.º 4
0
 /// <summary>
 /// Instantiates new <see cref="NorthAmericanWealth"/> for this instance
 /// and assigns a ref likewise to current <see cref="Spouse"/>
 /// </summary>
 protected internal void ResolveFinancialState()
 {
     _opes = new NorthAmericanWealth(this);
     _opes.CreateRandomAmericanOpes();
     var sp = Spouse?.Est as NorthAmerican;
     if (sp == null)
         return;
     sp._opes = _opes;
     foreach (var ca in _opes.CheckingAccounts)
         ca.IsJointAcct = true;
 }
Exemplo n.º 5
0
 public override Opes GetWealthAt(DateTime? dt)
 {
     return _opes ?? (_opes = new NorthAmericanWealth(this));
 }
Exemplo n.º 6
0
        public void TestGetRandomHomeLoan()
        {
            var amer = new NorthAmerican(NAmerUtil.GetWorkingAdultBirthDate(), Gender.Female);
            var testSubject = new NorthAmericanWealth(amer);

            testSubject.AddMortgage();

            var homeLoan = testSubject.HomeDebt.FirstOrDefault() as FixedRateLoan;
            Assert.IsNotNull(homeLoan);

            System.Diagnostics.Debug.WriteLine(homeLoan.TradeLine.Balance.ToString());
        }
Exemplo n.º 7
0
        public void TestGetRandomVehicle()
        {
            var amer = new NorthAmerican(NAmerUtil.GetWorkingAdultBirthDate(), Gender.Female);
            var testSubject = new NorthAmericanWealth(amer);
            System.Diagnostics.Debug.WriteLine(string.Join(" ", amer.Age, amer.MaritialStatus, amer.Education, amer.Race));

            var testResult = testSubject.AddVehicleLoan();
            Assert.IsNotNull(testResult);

            if (testSubject.VehicleDebt.Any())
            {

                var testResultSfrl = testSubject.VehicleDebt.First() as NoFuture.Rand.Data.Sp.SecuredFixedRateLoan;

                Assert.IsNotNull(testResultSfrl);

                System.Diagnostics.Debug.WriteLine(testResultSfrl.Description);

                Assert.IsNotNull( testResultSfrl.PropertyId);
            }
        }
Exemplo n.º 8
0
        public void TestGetRandomRent()
        {
            var amer = new NorthAmerican(NAmerUtil.GetWorkingAdultBirthDate(), Gender.Female);
            var testSubject = new NorthAmericanWealth(amer, true);

            testSubject.AddRent();
            var rent = testSubject.HomeDebt.FirstOrDefault() as Rent;
            Assert.IsNotNull(rent);

            System.Diagnostics.Debug.WriteLine(rent.TradeLine.Balance.ToString());
        }