Return-Path: X-Original-To: apmail-poi-dev-archive@www.apache.org Delivered-To: apmail-poi-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE5D1189B4 for ; Sun, 24 Jan 2016 01:13:14 +0000 (UTC) Received: (qmail 49903 invoked by uid 500); 24 Jan 2016 01:13:14 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 49856 invoked by uid 500); 24 Jan 2016 01:13:14 -0000 Mailing-List: contact dev-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Developers List" Delivered-To: mailing list dev@poi.apache.org Received: (qmail 49845 invoked by uid 99); 24 Jan 2016 01:13:14 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Jan 2016 01:13:14 +0000 Received: from asf-bz1-us-mid.priv.apache.org (nat1-us-mid.apache.org [23.253.172.122]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPS id 870C71A0593 for ; Sun, 24 Jan 2016 01:13:14 +0000 (UTC) Received: by asf-bz1-us-mid.priv.apache.org (ASF Mail Server at asf-bz1-us-mid.priv.apache.org, from userid 33) id 99036604CD; Sun, 24 Jan 2016 01:13:13 +0000 (UTC) From: bugzilla@apache.org To: dev@poi.apache.org Subject: [Bug 58787] [In progress] Border Drawing utility that does not create unnecessary styles Date: Sun, 24 Jan 2016 01:13:13 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: POI X-Bugzilla-Component: SS Common X-Bugzilla-Version: 3.14-dev X-Bugzilla-Keywords: PatchAvailable X-Bugzilla-Severity: enhancement X-Bugzilla-Who: onealj@apache.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@poi.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bz.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 https://bz.apache.org/bugzilla/show_bug.cgi?id=58787 --- Comment #12 from Javen O'Neal --- (In reply to Mark Murphy from comment #5) > Not real sure how to write unit tests for this since I need to > look at the generated spreadsheet to determine if it worked or not. I could > use some coaching on that. Sometimes writing unit tests is tough. At the bare minimum, a unit test can be used to show someone how the code was intended to be used (this works great as example code if you exclude the assertions). Unit tests should say what your code should and should not do. For example, createBorder(region, ALL) should create a left border on all cells in the first column of region, and should not create a left border on any column to the right of the first column in the region. You can and should review your results by opening the file in Excel, but that's probably the last time your feature will be tested using Excel unless there's a bug. Your unit test will have to assume some functionality is implemented correctly--which is fair to say about anything that the test wasn't explicitly written to test. This might mean writing: cell = row.createCell(0); //blank/empty cells don't have any style to start with. assertEquals(0, Util.getNumOfBorders(cell)); Util.setBorder(cell, LEFT); assertTrue(Util.isBorderSet(cell, LEFT)); // the right border should not be set assertFalse(Util.isBorderSet(cell, RIGHT)); -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org For additional commands, e-mail: dev-help@poi.apache.org