Package org.jmock

Examples of org.jmock.Expectations.atLeast()


        expectations.will(returnValue("ssss"));

        expectations.atLeast(0).of(firstNuspec).getDescription();
        expectations.will(returnValue("ffff"));

        expectations.atLeast(0).of(secondNuspec).getDescription();
        expectations.will(returnValue("ssss"));

        expectations.atLeast(0).of(firstNuspec).getTags();
        expectations.will(returnValue(new ArrayList<String>()));
View Full Code Here


    @Test
    public void testCompare() throws ParseException {
        //GIVEN
        Expectations expectations = new Expectations();
        PackageEntry firstEntry = context.mock(PackageEntry.class, "firstEntry");
        expectations.atLeast(0).of(firstEntry).getUpdated();
        expectations.will(returnValue(createDate("2012.04.27 15:30:00")));
        PackageEntry secondEntry = context.mock(PackageEntry.class, "secondEntry");
        expectations.atLeast(0).of(secondEntry).getUpdated();
        expectations.will(returnValue(createDate("2012.04.27 15:40:00")));
        context.checking(expectations);
View Full Code Here

        expectations.will(returnValue("ffff"));

        expectations.atLeast(0).of(secondNuspec).getDescription();
        expectations.will(returnValue("ssss"));

        expectations.atLeast(0).of(firstNuspec).getTags();
        expectations.will(returnValue(new ArrayList<String>()));

        expectations.atLeast(0).of(secondNuspec).getTags();
        expectations.will(returnValue(new ArrayList<String>()));
View Full Code Here

        Expectations expectations = new Expectations();
        PackageEntry firstEntry = context.mock(PackageEntry.class, "firstEntry");
        expectations.atLeast(0).of(firstEntry).getUpdated();
        expectations.will(returnValue(createDate("2012.04.27 15:30:00")));
        PackageEntry secondEntry = context.mock(PackageEntry.class, "secondEntry");
        expectations.atLeast(0).of(secondEntry).getUpdated();
        expectations.will(returnValue(createDate("2012.04.27 15:40:00")));
        context.checking(expectations);
        PackageUpdateDateDescComparator instance = new PackageUpdateDateDescComparator();
        //WHEN
        int result = instance.compare(firstEntry, secondEntry);
View Full Code Here

        expectations.will(returnValue("ssss"));

        expectations.atLeast(0).of(firstNuspec).getTags();
        expectations.will(returnValue(new ArrayList<String>()));

        expectations.atLeast(0).of(secondNuspec).getTags();
        expectations.will(returnValue(new ArrayList<String>()));

        context.checking(expectations);

        final String filterString = "(((Id ne null) and substringof('first',tolower(Id))) or ((Description ne null) and substringof('first',tolower(Description)))) or ((Tags ne null) and substringof('first',tolower(Tags)))";
View Full Code Here

        //Источник пакетов
        @SuppressWarnings("unchecked")
        PackageSource<? extends Nupkg> packageSource = context.mock(PackageSource.class);
        Expectations expectations = new Expectations();
        expectations.atLeast(0).of(packageSource).getPackages();
        expectations.will(returnValue(Arrays.asList(firstPackage, secondPackage)));
        expectations.atLeast(0).of(firstPackage).getId();
        expectations.will(returnValue("first.package"));
        expectations.atLeast(0).of(firstPackage).getNuspecFile();
        expectations.will(returnValue(firstNuspec));
View Full Code Here

    @Test
    public void testArraySort() throws ParseException {
        //GIVEN
        Expectations expectations = new Expectations();
        PackageEntry firstEntry = context.mock(PackageEntry.class, "firstEntry");
        expectations.atLeast(0).of(firstEntry).getUpdated();
        expectations.will(returnValue(createDate("2012.04.27 15:30:00")));
        PackageEntry secondEntry = context.mock(PackageEntry.class, "secondEntry");
        expectations.atLeast(0).of(secondEntry).getUpdated();
        expectations.will(returnValue(createDate("2012.04.27 15:40:00")));
        context.checking(expectations);
View Full Code Here

        Expectations expectations = new Expectations();
        PackageEntry firstEntry = context.mock(PackageEntry.class, "firstEntry");
        expectations.atLeast(0).of(firstEntry).getUpdated();
        expectations.will(returnValue(createDate("2012.04.27 15:30:00")));
        PackageEntry secondEntry = context.mock(PackageEntry.class, "secondEntry");
        expectations.atLeast(0).of(secondEntry).getUpdated();
        expectations.will(returnValue(createDate("2012.04.27 15:40:00")));
        context.checking(expectations);
        PackageEntry[] entrys = new PackageEntry[]{firstEntry, secondEntry};
        PackageUpdateDateDescComparator instance = new PackageUpdateDateDescComparator();
        //WHEN
View Full Code Here

        @SuppressWarnings("unchecked")
        PackageSource<? extends Nupkg> packageSource = context.mock(PackageSource.class);
        Expectations expectations = new Expectations();
        expectations.atLeast(0).of(packageSource).getPackages();
        expectations.will(returnValue(Arrays.asList(firstPackage, secondPackage)));
        expectations.atLeast(0).of(firstPackage).getId();
        expectations.will(returnValue("first.package"));
        expectations.atLeast(0).of(firstPackage).getNuspecFile();
        expectations.will(returnValue(firstNuspec));
        expectations.atLeast(0).of(secondPackage).getId();
        expectations.will(returnValue("second.package"));
View Full Code Here

        Expectations expectations = new Expectations();
        expectations.atLeast(0).of(packageSource).getPackages();
        expectations.will(returnValue(Arrays.asList(firstPackage, secondPackage)));
        expectations.atLeast(0).of(firstPackage).getId();
        expectations.will(returnValue("first.package"));
        expectations.atLeast(0).of(firstPackage).getNuspecFile();
        expectations.will(returnValue(firstNuspec));
        expectations.atLeast(0).of(secondPackage).getId();
        expectations.will(returnValue("second.package"));
        expectations.atLeast(0).of(secondPackage).getNuspecFile();
        expectations.will(returnValue(secondNuspec));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.