public void UpdateDtoTest() { var dtos = new HashSet <DomainObjectDTO>(); // 1. Add barebones LP. const string lpGuid = "9719A466-2240-4DEA-9722-9FE0746A30A6"; var lpDto = CreatoDTO(dtos, lpGuid, "LangProject", null); IDomainObjectDTORepository dtoRepos = new DomainObjectDtoRepository(1, dtos, m_mdc, null, TestDirectoryFinder.LcmDirectories); dtoRepos.Update(lpDto); Assert.IsTrue(((DomainObjectDtoRepository)dtoRepos).Dirtballs.Contains(lpDto), "Dirty DTO not in dirtball set."); }
public void UpdateUnknownDtoTest() { var dtos = new HashSet <DomainObjectDTO>(); // 1. Add barebones LP. const string lpGuid = "9719A466-2240-4DEA-9722-9FE0746A30A6"; CreatoDTO(dtos, lpGuid, "LangProject", null); IDomainObjectDTORepository dtoRepos = new DomainObjectDtoRepository(1, dtos, m_mdc, null, TestDirectoryFinder.LcmDirectories); var newGuid = Guid.NewGuid(); var newby = new DomainObjectDTO(newGuid.ToString(), "LexEntry", "<rt />"); Assert.That(() => dtoRepos.Update(newby), Throws.TypeOf <InvalidOperationException>()); }