Skip to content

Commit fceb3c1

Browse files
enzozafraEnzo Zafra
authored andcommitted
Merge pull request #104 from vrohit13/charge-service-tests
Improving code coverage for ChargeService #hacktoberfest
2 parents 1df63ba + 914b8a1 commit fceb3c1

File tree

2 files changed

+512
-0
lines changed

2 files changed

+512
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2017 Intuit
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*******************************************************************************/
16+
package com.intuit.ipp.query;
17+
18+
import org.testng.Assert;
19+
import org.testng.annotations.BeforeMethod;
20+
import org.testng.annotations.BeforeTest;
21+
import org.testng.annotations.Test;
22+
23+
public class PathTest {
24+
25+
/**
26+
* @author enzozafra
27+
*/
28+
private Path path;
29+
30+
private String entity;
31+
private String pathString;
32+
33+
@BeforeTest
34+
public void init() {
35+
entity = "entity";
36+
pathString = "pathString";
37+
}
38+
39+
@BeforeMethod
40+
public void setUp() {
41+
path = new Path(pathString, entity);
42+
}
43+
44+
@Test
45+
public void testAllGetters() {
46+
Assert.assertEquals(path.getEntity(), entity);
47+
Assert.assertEquals(path.getPathString(), pathString);
48+
}
49+
50+
@Test
51+
public void testAllSetters() {
52+
String newEntity = "new Entity";
53+
String newPathString = "new PathString";
54+
55+
path.setEntity(newEntity);
56+
path.setPathString(newPathString);
57+
58+
Assert.assertEquals(path.getEntity(), newEntity);
59+
Assert.assertEquals(path.getPathString(), newPathString);
60+
}
61+
}

0 commit comments

Comments
 (0)