public void EmployeePictureRepository_DeleteEmployeePicture_NoExists_NotFail_Test()
        {
            var context  = new MyCompanyContext();
            int expected = context.EmployeePictures.Count();

            IEmployeePictureRepository target = new EmployeePictureRepository(context);

            target.Delete(0);

            int actual = context.EmployeePictures.Count();

            Assert.AreEqual(expected, actual);
        }
        public void EmployeePictureRepository_DeleteEmployeePicture_Deleted_NotFail_Test()
        {
            var context         = new MyCompanyContext();
            var employeePicture = context.EmployeePictures.First();
            int expected        = context.EmployeePictures.Count() - 1;

            IEmployeePictureRepository target = new EmployeePictureRepository(context);

            target.Delete(employeePicture.EmployeePictureId);

            int actual = context.EmployeePictures.Count();

            Assert.AreEqual(expected, actual);
        }
示例#3
0
        ///<inheritdoc/>
        public override void Handle(BrokeredMessage message)
        {
            var employeePictureRepository = new EmployeePictureRepository(new MyCompanyContext());

            employeePictureRepository.Delete(message.GetBody <int>());
        }