-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into language-fix-1
- Loading branch information
Showing
63 changed files
with
1,241 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { StringUtils } from './string-utils'; | ||
import { CollectionUtils } from './collections-utils'; | ||
|
||
describe('CollectionUtils', () => { | ||
describe('fromString', () => { | ||
it('should return an empty collection if the string is undefined', () => { | ||
// Assert | ||
expect(CollectionUtils.fromString(undefined)).toEqual([]); | ||
}); | ||
|
||
it('should return an empty collection if the string is empty', () => { | ||
// Assert | ||
expect(CollectionUtils.fromString('')).toEqual([]); | ||
}); | ||
|
||
it('should return an empty collection if the string is whitespace', () => { | ||
// Assert | ||
expect(CollectionUtils.fromString(' ')).toEqual([]); | ||
}); | ||
|
||
it('should return an empty collection if the string is whitespace', () => { | ||
// Assert | ||
expect(CollectionUtils.fromString(' ')).toEqual([]); | ||
}); | ||
|
||
it('should return a collection with the given string as first item if it does not start with [', () => { | ||
// Assert | ||
expect(CollectionUtils.fromString('item1][item2]')).toEqual(['item1][item2]']); | ||
}); | ||
|
||
it('should return a collection with the given string as first item if it does not end with ]', () => { | ||
// Assert | ||
expect(CollectionUtils.fromString('[item1][item2')).toEqual(['[item1][item2']); | ||
}); | ||
|
||
it('should return a collection with the given string as first item if it does not start with [ and end with ]', () => { | ||
// Assert | ||
expect(CollectionUtils.fromString('item1][item2')).toEqual(['item1][item2']); | ||
}); | ||
|
||
it('should return a collection with the given string as first item if the string only has 1 item', () => { | ||
// Assert | ||
expect(CollectionUtils.fromString('[item1]')).toEqual(['item1']); | ||
}); | ||
|
||
it('should return a collection with all items if the string only has multiple items', () => { | ||
// Assert | ||
expect(CollectionUtils.fromString('[item1][item2][item3]')).toEqual(['item1', 'item2', 'item3']); | ||
}); | ||
}); | ||
|
||
describe('toString', () => { | ||
it('should return an empty string if the collection is undefined', () => { | ||
// Assert | ||
expect(CollectionUtils.toString(undefined)).toEqual(''); | ||
}); | ||
|
||
it('should return an empty string if the collection is empty', () => { | ||
// Assert | ||
expect(CollectionUtils.toString([])).toEqual(''); | ||
}); | ||
|
||
it('should return a string with the items joined by ][', () => { | ||
// Assert | ||
expect(CollectionUtils.toString(['item1', 'item2', 'item3'])).toEqual('[item1][item2][item3]'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { ArtistType } from '../artist/artist-type'; | ||
import { AlbumModel } from './album-model'; | ||
import { ArtistModel } from '../artist/artist-model'; | ||
|
||
export abstract class AlbumServiceBase { | ||
public abstract getAllAlbums(): AlbumModel[]; | ||
public abstract getAlbumsForArtists(artists: string[], artistType: ArtistType): AlbumModel[]; | ||
public abstract getAlbumsForArtists(artists: ArtistModel[], artistType: ArtistType): AlbumModel[]; | ||
public abstract getAlbumsForGenres(genres: string[]): AlbumModel[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.