@Test public void testParseShouldReturnHitcountWhenUsageIsHitcount() { given(dialogDescriptor.getAttribute("name")).willReturn("name"); given(dialogDescriptor.getAttribute("usage")).willReturn("hitcount"); given(dialogDescriptor.getAttribute("validityValue")).willReturn("2"); DialogDescriptorAttributes actual = underTest.getAttributes(dialogDescriptor); assertEquals(actual.getHitcount(), 2); }
public DialogDescriptorAttributes getAttributes(final Element el) { String name = el.getAttribute("name"); DialogDescriptorUsage usage = getUsage(el.getAttribute("usage")); long validityValue = getValidityValue(el.getAttribute("validityValue"), name, usage); String comment = el.getAttribute("comment"); DialogDescriptorAttributes attributes = createAttributes(name, usage, validityValue, comment); return attributes; }
DialogDescriptorAttributeParser { public DialogDescriptorAttributes getAttributes(final Element el) { String name = el.getAttribute("name"); DialogDescriptorUsage usage = getUsage(el.getAttribute("usage")); long validityValue = getValidityValue(el.getAttribute("validityValue"), name, usage); String comment = el.getAttribute("comment"); DialogDescriptorAttributes attributes = createAttributes(name, usage, validityValue, comment); return attributes; } }
DialogDescriptorAttributeParser { public DialogDescriptorAttributes getAttributes(final Element el) { String name = el.getAttribute("name"); DialogDescriptorUsage usage = getUsage(el.getAttribute("usage")); long validityValue = getValidityValue(el.getAttribute("validityValue"), name, usage); String comment = el.getAttribute("comment"); DialogDescriptorAttributes attributes = createAttributes(name, usage, validityValue, comment); return attributes; }  }
DialogDescriptorAttributeParser { public DialogDescriptorAttributes getAttributes(final Element el) { String name = el.getAttribute("name"); DialogDescriptorUsage usage = getUsage(el.getAttribute("usage")); long validityValue = getValidityValue(el.getAttribute("validityValue"), name, usage); String comment = el.getAttribute("comment"); DialogDescriptorAttributes attributes = createAttributes(name, usage, validityValue, comment); return attributes; }  DialogDescriptorAttributes getAttributes(final Element el); }
DialogDescriptorAttributeParser { public DialogDescriptorAttributes getAttributes(final Element el) { String name = el.getAttribute("name"); DialogDescriptorUsage usage = getUsage(el.getAttribute("usage")); long validityValue = getValidityValue(el.getAttribute("validityValue"), name, usage); String comment = el.getAttribute("comment"); DialogDescriptorAttributes attributes = createAttributes(name, usage, validityValue, comment); return attributes; }  DialogDescriptorAttributes getAttributes(final Element el);  }