/* tslint:disable:no-unused-variable */

import {
  beforeEach, beforeEachProviders,
  describe, xdescribe,
  expect, it, xit,
  async, inject
} from '@angular/core/testing';
import { Storage } from './storage.class';
var victim : Storage;

describe('Storage Service', () => {
  beforeEachProviders(() => [Storage]);

  beforeEach( () => {
    victim = new Storage();
  } );

  describe( 'always', () => {
    it('should expose get method', () => {
      expect(typeof victim.get ).toBe( 'function' );
    } );

    it('should expose set method', () => {
      expect(typeof victim.set ).toBe( 'function' );
    } );

    it( 'should be a singleton', () => {
      expect( victim ).toBe( new Storage() );
    } );
  } );

  describe( 'when get method is called before any set call', () => {
    beforeEach( () => {
      window.localStorage.clear();
      victim = new Storage();
    } );

    it( 'should return a empty object', () => {
      expect( victim.get() ).toEqual( [] );
    } );
  } );

  describe( 'when when we set some value', () => {
    var itemsToSave : Object = [ { id: '1' } ]

    beforeEach( () => {
      victim.set( itemsToSave );
    } );

    it( 'should ', () => {
      expect( victim.get() ).toEqual( itemsToSave );
});
    } );
  } );