Package org.zanata.webtrans.shared.model

Examples of org.zanata.webtrans.shared.model.TransHistoryItem


                ContentState.Approved, "", new Date());
    }

    @Test
    public void testAddWhenItsEmpty() throws Exception {
        TransHistoryItem newItem = newItem("1");
        pair = ComparingPair.empty().tryAddOrRemoveIfExists(newItem);

        assertThat(pair.one(), Matchers.sameInstance(newItem));
        assertThat(pair.two(), Matchers.nullValue());
    }
View Full Code Here


        assertThat(pair.two(), Matchers.nullValue());
    }

    @Test
    public void addSameItemTwiceWillRemoveIt() {
        TransHistoryItem newItem = newItem("1");
        pair =
                ComparingPair.empty().tryAddOrRemoveIfExists(newItem)
                        .tryAddOrRemoveIfExists(newItem);

        assertThat(pair.one(), Matchers.nullValue());
View Full Code Here

        assertThat(pair.two(), Matchers.nullValue());
    }

    @Test
    public void addSameItemToFullPairWillBeIgnored() throws Exception {
        TransHistoryItem one = newItem("1");
        TransHistoryItem two = newItem("2");
        TransHistoryItem three = newItem("3");
        pair =
                ComparingPair.empty().tryAddOrRemoveIfExists(one)
                        .tryAddOrRemoveIfExists(two);

        assertThat(pair.isFull(), Matchers.is(true));
View Full Code Here

        assertThat(pair.two(), Matchers.sameInstance(two));
    }

    @Test
    public void testContains() throws Exception {
        TransHistoryItem one = newItem("1");
        TransHistoryItem two = newItem("2");
        pair = ComparingPair.empty().tryAddOrRemoveIfExists(one);

        assertThat(pair.contains(one), Matchers.is(true));
        assertThat(pair.contains(two), Matchers.is(false));
    }
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.shared.model.TransHistoryItem

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.