### Question:
LESSSkinFileResourceReference implements LESSResourceReference { @Override public String getContent(String skin) throws LESSCompilerException { Template template = templateManager.getTemplate("less/" + fileName, skinManager.getSkin(skin)); if (template == null) { throw new LESSCompilerException(String.format("The template [%s] does not exists.", fileName)); } try { return template.getContent().getContent(); } catch (Exception e) { throw new LESSCompilerException( String.format("Failed to get the content of the template [%s].", fileName), e); } } LESSSkinFileResourceReference(String fileName, TemplateManager templateManager, SkinManager skinManager); @Override boolean equals(Object o); @Override int hashCode(); @Override String getContent(String skin); @Override String serialize(); @Override String toString();  }### Answer:
@Test public void getContent() throws Exception { LESSSkinFileResourceReference lessSkinFileResourceReference = new LESSSkinFileResourceReference("style.less", templateManager, skinManager); Template template = mock(Template.class); when(templateManager.getTemplate("less/style.less", skin)).thenReturn(template); TemplateContent templateContent = mock(TemplateContent.class); when(template.getContent()).thenReturn(templateContent); when(templateContent.getContent()).thenReturn(" assertEquals(" }
@Test public void getContentWhenFileDoesNotExist() throws Exception { LESSSkinFileResourceReference lessSkinFileResourceReference = new LESSSkinFileResourceReference("not-existing-file.less", templateManager, skinManager); LESSCompilerException caughtException = null; try { lessSkinFileResourceReference.getContent("skin"); } catch (LESSCompilerException e) { caughtException = e; } assertNotNull(caughtException); assertEquals("The template [not-existing-file.less] does not exists.", caughtException.getMessage()); }
@Test public void getContentWhenException() throws Exception { LESSSkinFileResourceReference lessSkinFileResourceReference = new LESSSkinFileResourceReference("file.less", templateManager, skinManager); Template template = mock(Template.class); when(templateManager.getTemplate("less/file.less", skin)).thenReturn(template); Exception exception = new Exception("exception"); when(template.getContent()).thenThrow(exception); LESSCompilerException caughtException = null; try { lessSkinFileResourceReference.getContent("skin"); } catch (LESSCompilerException e) { caughtException = e; } assertNotNull(caughtException); assertEquals("Failed to get the content of the template [file.less].", caughtException.getMessage()); assertEquals(exception, caughtException.getCause()); }