示例#1
0
        public void TestCreateAndUpdateMFISuccess()
        {
            MFI returnedMFI = new MFI();
            MFI newMFI      = new MFI {
                Name = "UpdatedName", Password = "******", Login = "******"
            };

            _mfiManager.CreateMFI(_mfi);

            bool result = _mfiManager.UpdateMFI(newMFI);

            Assert.IsTrue(result);

            returnedMFI = _mfiManager.SelectMFI();

            Assert.AreEqual(newMFI.Login, returnedMFI.Login);
            Assert.AreEqual(newMFI.Name, returnedMFI.Name);
            Assert.AreEqual(newMFI.Password, returnedMFI.Password);
        }
示例#2
0
        public bool UpdateMFI(MFI pMFI)
        {
            if (pMFI.Name == String.Empty)
            {
                throw new OpenCbsMfiExceptions(OpenCbsMFIExceptionEnum.NameIsEmpty);
            }

            if (pMFI.Login == String.Empty)
            {
                throw new OpenCbsMfiExceptions(OpenCbsMFIExceptionEnum.LoginIsNotFilled);
            }

            if (pMFI.Password == String.Empty)
            {
                throw new OpenCbsMfiExceptions(OpenCbsMFIExceptionEnum.PasswordIsNotFilled);
            }

            return(_MFIManager.UpdateMFI(pMFI));
        }