Skip to content

Commit

Permalink
More Mocks
Browse files Browse the repository at this point in the history
admob
admob-free
app-preferences
app-rate
app-version
background-geolocation
badge
base64
base64-to-gallery
battery-status
file
gyroscope
in-app-browser
local-notifications
phonegap-local-notification
push
screen-orientation
secure-storage
  • Loading branch information
chrisgriffith committed Jul 7, 2017
1 parent 1707b51 commit ac13895
Show file tree
Hide file tree
Showing 20 changed files with 3,071 additions and 1 deletion.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<a name="1.0.2"></a>
## [1.0.2](https://github.com/chrisgriffith/ionic-native-mocks) (2017-07-05)

### Features
Inital Release
- actions-sheets
- barcode-scanner
- ble
- bluetooth-serial
- calendar
- camera
- contacts
- date-picker
- db-meter
- device-motion
- device-orientation
- device
- dialog
- email-composer
- geolocation
- globalization
- image-picker
- keyboard
- network
- social-sharing
- splash-screen
- sqlite
- status-bar
- toast
- touch-id
- vibration
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ionic-native-mocks",
"version": "1.0.2",
"version": "1.0.3",
"description": "Mocks for Ionic Native for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"homepage": "https://ionicframework.com/",
"author": "Chris Griffith <[email protected]> (https://aj-sofwtare.com)",
Expand Down
229 changes: 229 additions & 0 deletions src/@ionic-native-mocks/plugins/admob-free/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
import { AdMobFree } from '@ionic-native/admob-free';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import 'rxjs/add/observable/fromEvent';

export interface AdMobFreeBannerConfig {
/**
* Ad Unit ID
*/
id?: string;
/**
* Receiving test ad
*/
isTesting?: boolean;
/**
* Auto show ad when loaded
*/
autoShow?: boolean;
/**
* Set to true, to put banner at top
*/
bannerAtTop?: boolean;
/**
* Set to true, to allow banner overlap WebView
*/
overlap?: boolean;
/**
* Set to true to avoid ios7 status bar overlap
*/
offsetTopBar?: boolean;
/**
* Banner size
*/
size?: string;
}
export interface AdMobFreeInterstitialConfig {
/**
* Ad Unit ID
*/
id?: string;
/**
* Receiving test ad
*/
isTesting?: boolean;
/**
* Auto show ad when loaded
*/
autoShow?: boolean;
}
export interface AdMobFreeRewardVideoConfig {
/**
* Ad Unit ID
*/
id?: string;
/**
* Receiving test ad
*/
isTesting?: boolean;
/**
* Auto show ad when loaded
*/
autoShow?: boolean;
}

export class AdMobFreeMock extends AdMobFree {
/**
* Convenience object to get event names
* @type {Object}
*/
events: any;
/**
* Watch an event
* @param event {string} event name
* @return {Observable<any>}
*/
on(event: string): Observable<any> {
return Observable.create((observer: Observer<any>) => {
observer.next('');
observer.complete();
});
};
/**
* Returns the AdMobFreeBanner object
* @type {AdMobFreeBanner}
*/
banner: AdMobFreeBanner;
/**
* Returns the AdMobFreeInterstitial object
* @type {AdMobFreeInterstitial}
*/
interstitial: AdMobFreeInterstitial;
/**
* Returns the AdMobFreeRewardVideo object
* @type {AdMobFreeRewardVideo}
*/
rewardVideo: AdMobFreeRewardVideo;
}
/**
* @hidden
*/
export class AdMobFreeBanner {
/**
* Update config.
* @param options
* @return {AdMobFreeBannerConfig}
*/
config(options: AdMobFreeBannerConfig): AdMobFreeBannerConfig {
let config: AdMobFreeBannerConfig;
return config;
};
/**
* Hide the banner.
* @return {Promise<any>}
*/
hide(): Promise<any> {
return new Promise((resolve, reject) => {
resolve();
});
};
/**
* Create banner.
* @return {Promise<any>}
*/
prepare(): Promise<any> {
return new Promise((resolve, reject) => {
resolve();
});
};
/**
* Remove the banner.
* @return {Promise<any>}
*/
remove(): Promise<any> {
return new Promise((resolve, reject) => {
resolve();
});
};
/**
* Show the banner.
* @return {Promise<any>}
*/
show(): Promise<any> {
return new Promise((resolve, reject) => {
resolve();
});
};
}
/**
* @hidden
*/
export class AdMobFreeInterstitial {
/**
* Update config.
* @param options
* @return {AdMobFreeInterstitialConfig}
*/
config(options: AdMobFreeInterstitialConfig): AdMobFreeInterstitialConfig {
let config: AdMobFreeInterstitialConfig;
return config;
};
/**
* Check if interstitial is ready
* @return {Promise<any>}
*/
isReady(): Promise<any> {
return new Promise((resolve, reject) => {
resolve();
});
};
/**
* Prepare interstitial
* @return {Promise<any>}
*/
prepare(): Promise<any> {
return new Promise((resolve, reject) => {
resolve();
});
};
/**
* Show the interstitial
* @return {Promise<any>}
*/
show(): Promise<any> {
return new Promise((resolve, reject) => {
resolve();
});
};
}
/**
* @hidden
*/
export class AdMobFreeRewardVideo {
/**
* Update config.
* @param options
* @return {AdMobFreeRewardVideoConfig}
*/
config(options: AdMobFreeRewardVideoConfig): AdMobFreeRewardVideoConfig {
let config: AdMobFreeRewardVideoConfig;
return config;
};
/**
* Check if reward video is ready
* @return {Promise<any>}
*/
isReady(): Promise<any> {
return new Promise((resolve, reject) => {
resolve();
});
};
/**
* Prepare reward video
* @return {Promise<any>}
*/
prepare(): Promise<any> {
return new Promise((resolve, reject) => {
resolve();
});
};
/**
* Show the reward video
* @return {Promise<any>}
*/
show(): Promise<any> {
return new Promise((resolve, reject) => {
resolve();
});
};
}
Loading

0 comments on commit ac13895

Please sign in to comment.