コード例 #1
0
        public void CreateMailMethodFromRow()
        {
            operation = new LoadPaymentMethodOperation(employee, "mail", null);
            operation.Prepare();
            DataRow row = LoadEmployeeOperationTest.ShuntRow(
                "Address", "23 Pine Ct");

            operation.CreatePaymentMethod(row);

            PaymentMethod method = operation.Method;

            Assert.IsTrue(method is MailMethod);
            MailMethod mailMethod = method as MailMethod;

            Assert.AreEqual("23 Pine Ct", mailMethod.Address);
        }
コード例 #2
0
        public void CreateSalariedClassificationFromRow()
        {
            operation = new LoadClassificationOperation(employee, "salaried", null);
            operation.Prepare();
            DataRow row = LoadEmployeeOperationTest.ShuntRow("Salary", "1254.25");

            operation.CreateClassification(row);

            PaymentClassification classification = operation.Classification;

            Assert.IsTrue(classification is SalariedClassification);
            SalariedClassification salariedClassification =
                classification as SalariedClassification;

            Assert.AreEqual(1254.25, salariedClassification.Salary);
        }
コード例 #3
0
        public void CreateDirectDepositMethodFromRow()
        {
            operation = new LoadPaymentMethodOperation(employee, "directdeposit", null);
            operation.Prepare();
            DataRow row = LoadEmployeeOperationTest.ShuntRow(
                "Bank,Account", "1st Bank", "0123456");

            operation.CreatePaymentMethod(row);

            PaymentMethod method = operation.Method;

            Assert.IsTrue(method is DirectDepositMethod);
            DirectDepositMethod ddMethod = method as DirectDepositMethod;

            Assert.AreEqual("1st Bank", ddMethod.Bank);
            Assert.AreEqual("0123456", ddMethod.AccountNumber);
        }