public void GetRequiredByCode_WhenNotExists_Throws() { var entityDefinitions = GetBaseCustomEntityDefinitions(); var repo = new CustomEntityDefinitionRepository(entityDefinitions); repo.Invoking(r => r.GetRequiredByCode("UNIQUE")) .Should() .Throw <EntityNotFoundException <ICustomEntityDefinition> >(); }