public void UpdatingBatchOperatorAtIdResultsInNewBatchOperatorInfoWhenLookedUp()
        {
            int           targetCollectionId = 0;
            string        expectedFirstName  = "John";
            string        expectedLastName   = "Doe";
            BatchOperator batchOperator      = helper.GetUnsavedJaneDoeOperator();

            operatorSource.SaveOperator(batchOperator);

            int targetId = operatorSource.BatchOperatorIdMappings[targetCollectionId];

            operatorSource.UpdateOperator(targetId, helper.GetUnsavedJohnDoeOperator());
            BatchOperator found = operatorSource.FindBatchOperator(targetId);

            Assert.AreEqual(expectedFirstName, found.FirstName);
            Assert.AreEqual(expectedLastName, found.LastName);
        }
Beispiel #2
0
        public void PersistBatchOperator()
        {
            BatchOperator batchOperator = new BatchOperator(FirstName, LastName);

            if (SelectedBatchOperatorFromComboBoxIndex > 0)
            {
                int targetId = operatorSource.BatchOperatorIdMappings[SelectedBatchOperatorFromComboBoxIndex - 1];
                operatorSource.UpdateOperator(targetId, batchOperator);
            }
            else
            {
                operatorSource.SaveOperator(batchOperator);
            }

            ResetBatchOperator();
            SelectedBatchOperatorFromComboBoxIndex = -1;
            NotifyPropertyChanged("OperatorNames");
        }