package org.graphwalker.core.condition;

/*
 * #%L
 * GraphWalker Core
 * %%
 * Copyright (C) 2011 - 2014 GraphWalker
 * %%
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 * #L%
 */

import org.junit.Assert;
import org.junit.Test;

import static org.hamcrest.core.Is.is;

/**
 * @author Nils Olsson
 */
public class VertexCoverageTest {

    @Test
    public void testConstructor() {
        VertexCoverage vertexCoverage = new VertexCoverage(55);
        Assert.assertThat(vertexCoverage.getPercent(), is(55));
    }

    @Test
    public void testFulfilment() {
        // TODO:
    }

    @Test
    public void testIsFulfilled() {
        // TODO:
    }
}

@@ -1203,16 +1203,243 @@
 L%25%0A */%0A%0A
+import org.graphwalker.core.generator.RandomPath;%0Aimport org.graphwalker.core.machine.ExecutionContext;%0Aimport org.graphwalker.core.model.Edge;%0Aimport org.graphwalker.core.model.Model;%0Aimport org.graphwalker.core.model.Vertex;%0A
 import o
@@ -1823,86 +1823,1463 @@
     
-// TODO:%0A    %7D%0A%0A    @Test%0A    public void testIsFulfilled() %7B%0A        // TODO:
+Vertex v1 = new Vertex();%0A        Vertex v2 = new Vertex();%0A        Model model = new Model().addEdge(new Edge().setSourceVertex(v1).setTargetVertex(v2));%0A        VertexCoverage vertexCoverage = new VertexCoverage(100);%0A        ExecutionContext context = new ExecutionContext(model, new RandomPath(vertexCoverage));%0A        Assert.assertThat(vertexCoverage.getFulfilment(context), is(0.0));%0A        context.setCurrentElement(v1.build());%0A        context.getProfiler().start();%0A        Assert.assertThat(vertexCoverage.getFulfilment(context), is(0.5));%0A        context.setCurrentElement(v2.build());%0A        context.getProfiler().start();%0A        Assert.assertThat(vertexCoverage.getFulfilment(context), is(1.0));%0A    %7D%0A%0A    @Test%0A    public void testIsFulfilled() %7B%0A        Vertex v1 = new Vertex();%0A        Vertex v2 = new Vertex();%0A        Model model = new Model().addEdge(new Edge().setSourceVertex(v1).setTargetVertex(v2));%0A        VertexCoverage vertexCoverage = new VertexCoverage(100);%0A        ExecutionContext context = new ExecutionContext(model, new RandomPath(vertexCoverage));%0A        Assert.assertFalse(vertexCoverage.isFulfilled(context));%0A        context.setCurrentElement(v1.build());%0A        context.getProfiler().start();%0A        Assert.assertFalse(vertexCoverage.isFulfilled(context));%0A        context.setCurrentElement(v2.build());%0A        context.getProfiler().start();%0A        Assert.assertTrue(vertexCoverage.isFulfilled(context));
 %0A   

Add more tests