private void Insert_Salary()
        {
            Salary repository = new Salary();

            if (repository.Add(get_Data_From_Form()))
            {
                this.ShowSuccessfulNotification("Salary added successfully");
                clear_form();
                Load_Data_Grid();
            }
            else
            {
                this.ShowErrorNotification("Error occured");
            }
        }
Ejemplo n.º 2
0
        public void ShouldAddSalaries()
        {
            var salaryA = new Salary(51, Currency.Dollar);
            var salaryB = new Salary(52, Currency.Dollar);
            var salary  = salaryA.Add(salaryB);

            Assert.AreEqual(51.0, salaryA.Value);
            Assert.AreEqual(Currency.Dollar, salaryA.Currency);

            Assert.AreEqual(52.0, salaryB.Value);
            Assert.AreEqual(Currency.Dollar, salaryB.Currency);

            Assert.AreEqual(103.0, salary.Value);
            Assert.AreEqual(Currency.Dollar, salary.Currency);
        }
Ejemplo n.º 3
0
 public void ShouldThrowExceptionWhenAddDifferentCurrency()
 {
     var salaryA   = new Salary(51, Currency.Dollar);
     var salaryB   = new Salary(52, Currency.Rub);
     var exception = Assert.Throws <SalaryOperationException> (() => salaryA.Add(salaryB));
 }
 public void AddEmployee(string name, int salary)
 {
     Name.Add(name);
     Salary.Add(salary);
 }