Example #1
0
        public void TestDeductionsAllPresent()
        {
            var testInput = new AmericanEmployment();

            var options = new AmericanDomusOpesOptions
            {
                Inception = DateTime.Today.AddYears(-1),
                SumTotal  = 75000D
            };

            testInput.RandomizeAllItems(options);

            //check input is good
            Assert.IsNotNull(testInput.MyItems);
            Assert.AreNotEqual(0, testInput.MyItems.Count);

            var diff = Math.Abs(testInput.Total.ToDouble() - 75000);

            Console.WriteLine(diff);
            Assert.IsTrue(Math.Round(diff) == 0.0D);

            var testSubject = new AmericanDeductions(testInput);

            testSubject.RandomizeAllItems(null);

            var testResults        = testSubject.GetAt(DateTime.Today.AddDays(-182));
            var allDeductionsItesm = WealthBaseTests.GetExpectedNamesFromXml("deduction");

            Assert.IsNotNull(testResults);
            Assert.IsNotNull(allDeductionsItesm);

            Assert.AreEqual(allDeductionsItesm.Count, testResults.Length);
        }
Example #2
0
        public void TestGetItemNames()
        {
            var testSubject  = new AmericanDeductions();
            var testNames    = testSubject.GetItemNames(testSubject.DivisionName);
            var allNames     = WealthBaseTests.GetExpectedNamesFromXml("deduction");
            var expectations = allNames.Select(n => n.Item2).Distinct();

            foreach (var tn in testNames)
            {
                Assert.IsTrue(expectations.Any(e => string.Equals(e, tn.Name, StringComparison.OrdinalIgnoreCase)));
                Console.WriteLine(tn);
            }
        }
Example #3
0
        public void TestGetItemNames()
        {
            var testSubject  = new AmericanIncome();
            var testNames    = testSubject.GetItemNames();
            var allNames     = WealthBaseTests.GetExpectedNamesFromXml("income");
            var expectations = allNames.Select(n => n.Item2).Distinct();

            foreach (var tn in testNames)
            {
                Assert.IsTrue(expectations.Any(e => string.Equals(e, tn.Name, StringComparison.OrdinalIgnoreCase)));
                System.Diagnostics.Debug.WriteLine(tn);
            }
        }