Code example for MockContext

0
		Container container = AndroidMock.createMock(Container.class);
		InputStream in = AndroidMock.createMock(InputStream.class);
		 
		InputStream[] inArray = {in};
		 
		MockContext mockContext = new MockContext();
		 
		AndroidIOC ioc = new AndroidIOC();
		 
		final int returned = 10;
		 
		AndroidMock.expect(builder.build(AndroidMock.eq(mockContext), AndroidMock.eq(inArray))).andReturn(container);
		AndroidMock.expect(container.size()).andReturn(returned);
		 
		AndroidMock.replay(builder);
		AndroidMock.replay(container);
		 
		ioc.init(mockContext, builder, inArray);
		 
		assertEquals(10, ioc.size());
		 
		AndroidMock.verify(builder);
		AndroidMock.verify(container);