Package smartrics.rest.fitnesse.fixture.support

Examples of smartrics.rest.fitnesse.fixture.support.StringTypeAdapter


    @Test
    public void shouldDisplayGrayedActualOnCheckIfNoExpectedIsSpecified() {
        SlimCell c = new SlimCell("");
        SlimFormatter formatter = new SlimFormatter();
        StringTypeAdapter actual = new StringTypeAdapter();
        actual.set("2");
        formatter.check(c, actual);
        assertThat(c.body(), is(equalTo("report:<div>2</div>")));
    }
View Full Code Here


    @Test
    public void shouldDisplayNothingOnCheckIfNoExpectedIsSpecifiedAndActualIsNullOrEmpty() {
        SlimCell c = new SlimCell("");
        SlimFormatter formatter = new SlimFormatter();
        StringTypeAdapter actual = new StringTypeAdapter();
        formatter.check(c, actual);
        assertThat(c.body(), is(equalTo("")));
        actual.set("");
        assertThat(c.body(), is(equalTo("")));
    }
View Full Code Here

    @Test
    public void shouldDisplayPassOnCheckIfExpectedAndActualMatch() {
        SlimCell c = new SlimCell("abc123");
        SlimFormatter formatter = new SlimFormatter();
        StringTypeAdapter actual = new StringTypeAdapter();
        actual.set("abc123");
        formatter.check(c, actual);
        assertThat(c.body(), is(equalTo("pass:<div>abc123</div>")));
    }
View Full Code Here

        // mockito seems not to be able to correctly allow
        // StringTypeAdapter actual = mock(StringTypeAdapter.class);
        // when(actual).equals(isA(Object.class, Object.class)).thenReturn(true)
        // as its not picking up the overridden method but
        // Object.equals(Object).
        StringTypeAdapter actual = new StringTypeAdapter() {
            @Override
            public boolean equals(Object a, Object b) {
                return true;
            }
        };
        actual.set("abc123");
        formatter.check(c, actual);

        assertThat(
                c.body(),
                is(equalTo("pass:<div>something&nbsp;matching&nbsp;logically&nbsp;abc123<br/><i><span class='fit_label'>expected</span></i><hr/><br/>abc123<br/><i><span class='fit_label'>actual</span></i></div>")));
View Full Code Here

    @Test
    public void shouldDisplayFailOnCheckIfExpectedAndActualMatch_whenNotDisplayingActual() {
        SlimCell c = new SlimCell("abc123");
        SlimFormatter formatter = new SlimFormatter();
        formatter.setDisplayActual(false);
        StringTypeAdapter actual = new StringTypeAdapter();
        actual.set("def345");
        formatter.check(c, actual);
        assertThat(c.body(), is(equalTo("fail:<div>abc123</div>")));
    }
View Full Code Here

    @Test
    public void shouldDisplayFailOnCheckIfExpectedAndActualMatch_whenDisplayingActual() {
        SlimCell c = new SlimCell("abc123");
        SlimFormatter formatter = new SlimFormatter();
        formatter.setDisplayActual(true);
        StringTypeAdapter actual = new StringTypeAdapter();
        actual.set("def345");
        formatter.check(c, actual);

        assertThat(c.body(), is(equalTo("fail:<div>abc123<br/><i><span class='fit_label'>expected</span></i><hr/><br/>def345<br/><i><span class='fit_label'>actual</span></i></div>")));
    }
View Full Code Here

        verifyNoMoreInteractions(mockDelegate);
    }

    @Test
    public void delegatesCallToCheck() {
        StringTypeAdapter ta = new StringTypeAdapter();
        formatter.check(new FitCell(dummyParse), ta);
        verify(mockDelegate).check(dummyParse, ta);
        verifyNoMoreInteractions(mockDelegate);
    }
View Full Code Here

TOP

Related Classes of smartrics.rest.fitnesse.fixture.support.StringTypeAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.