public WorkMethodology GetByCode(string code)
        {
            if (string.IsNullOrWhiteSpace(code))
            {
                throw new InvalidOperationException("The code can't be null or empty");
            }

            return(_dataAccess.GetByCode(code));
        }
Example #2
0
 public void CanGetByCode()
 {
     if (_repository.Create(workMethodologyTest))
     {
         WorkMethodology workMethodologyFinded = _repository.GetByCode(workMethodologyTest.Code);
         Assert.AreEqual(workMethodologyTest, workMethodologyFinded);
     }
     else
     {
         Assert.Fail("Can't create the sex object for test");
     }
 }