Package org.jmock

Examples of org.jmock.Expectations.atLeast()


        Nupkg package2 = createPackageStub("id2", "1.2.3");

        @SuppressWarnings("unchecked")
        final PackageSource<Nupkg> source = context.mock(PackageSource.class);
        Expectations expectations = new Expectations();
        expectations.atLeast(0).of(source).getPackages();
        expectations.will(returnValue(Arrays.asList(package1, package2)));
        expectations.atLeast(0).of(package1).getTargetFramework();
        expectations.will(returnValue(EnumSet.allOf(Framework.class)));
        expectations.atLeast(0).of(package2).getTargetFramework();
        expectations.will(returnValue(EnumSet.of(Framework.net20)));
View Full Code Here


        @SuppressWarnings("unchecked")
        final PackageSource<Nupkg> source = context.mock(PackageSource.class);
        Expectations expectations = new Expectations();
        expectations.atLeast(0).of(source).getPackages();
        expectations.will(returnValue(Arrays.asList(package1, package2)));
        expectations.atLeast(0).of(package1).getTargetFramework();
        expectations.will(returnValue(EnumSet.allOf(Framework.class)));
        expectations.atLeast(0).of(package2).getTargetFramework();
        expectations.will(returnValue(EnumSet.of(Framework.net20)));
        context.checking(expectations);
        //WHEN
View Full Code Here

        Expectations expectations = new Expectations();
        expectations.atLeast(0).of(source).getPackages();
        expectations.will(returnValue(Arrays.asList(package1, package2)));
        expectations.atLeast(0).of(package1).getTargetFramework();
        expectations.will(returnValue(EnumSet.allOf(Framework.class)));
        expectations.atLeast(0).of(package2).getTargetFramework();
        expectations.will(returnValue(EnumSet.of(Framework.net20)));
        context.checking(expectations);
        //WHEN
        @SuppressWarnings("unchecked")
        Collection<Nupkg> result = (Collection<Nupkg>) executor.execQuery(source, null, null, "NET11");
View Full Code Here

        //GIVEN
        TempNupkgFile nupkg = new TempNupkgFile(this.getClass().getResourceAsStream("/NUnit.2.5.9.10348.nupkg"));
        @SuppressWarnings("unchecked")
        final PackageSource<Nupkg> source = context.mock(PackageSource.class);
        Expectations expectations = new Expectations();
        expectations.atLeast(0).of(source).getLastVersionPackages();
        expectations.will(returnValue(Arrays.asList(nupkg)));
        context.checking(expectations);
        QueryExecutor executor = new QueryExecutor();
        //WHEN
        Collection<? extends Nupkg> nupkgs = executor.execQuery(source, "IsLatestVersion", null, "net20");
View Full Code Here

     * @throws NugetFormatException версиz не соответствует формату
     */
    private Nupkg createPackageStub(String id, String version) throws NugetFormatException {
        Nupkg result = context.mock(Nupkg.class, id + ":" + version);
        Expectations expectations = new Expectations();
        expectations.atLeast(0).of(result).getId();
        expectations.will(returnValue(id));
        expectations.atLeast(0).of(result).getVersion();
        expectations.will(returnValue(Version.parse(version)));
        context.checking(expectations);
        return result;
View Full Code Here

    private Nupkg createPackageStub(String id, String version) throws NugetFormatException {
        Nupkg result = context.mock(Nupkg.class, id + ":" + version);
        Expectations expectations = new Expectations();
        expectations.atLeast(0).of(result).getId();
        expectations.will(returnValue(id));
        expectations.atLeast(0).of(result).getVersion();
        expectations.will(returnValue(Version.parse(version)));
        context.checking(expectations);
        return result;
    }
}
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.