Skip to content
Browse files

primeiro commit

  • Loading branch information...
0 parents commit 1950246929f3460fcd61dd240d2db482e55d7d9f @csokol committed
Showing with 73 additions and 0 deletions.
  1. +7 −0 .classpath
  2. +1 −0 .gitignore
  3. +17 −0 .project
  4. +12 −0 .settings/org.eclipse.jdt.core.prefs
  5. +10 −0 src/Imposto.java
  6. +13 −0 src/ImpostoTest.java
  7. +13 −0 src/Orcamento.java
7 .classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
1 .gitignore
@@ -0,0 +1 @@
+bin/
17 .project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jenkins-exemplo</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
12 .settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Mon Mar 26 17:39:10 BRT 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
10 src/Imposto.java
@@ -0,0 +1,10 @@
+public class Imposto {
+
+ public Imposto() {
+ }
+
+ public double calcula(Orcamento orcamento) {
+ return orcamento.getValor() * 0.1;
+ }
+
+}
13 src/ImpostoTest.java
@@ -0,0 +1,13 @@
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class ImpostoTest {
+
+ @Test
+ public void deveCalcularImpostoDeDezPorCento() {
+ Orcamento orcamento = new Orcamento(100.0);
+ Imposto imposto = new Imposto();
+ assertEquals(10.0, imposto.calcula(orcamento), Double.MIN_VALUE);
+ }
+}
13 src/Orcamento.java
@@ -0,0 +1,13 @@
+public class Orcamento {
+
+ private double valor;
+
+ public Orcamento(double valor) {
+ this.valor = valor;
+ }
+
+ public double getValor() {
+ return valor;
+ }
+
+}

0 comments on commit 1950246

Please sign in to comment.
Something went wrong with that request. Please try again.