public void WhenIRequestTheChordFromTheApi(string p0) { var browser = new Browser(with => { with.Module <ChordModule>(); var instance = new ChordRepository(); with.Dependency <IChordRepository>(instance); }); // Act var path = string.Format("/chord/{0}/", p0); _apiResponse = browser.Get(path, with => with.Accept("application/json")); }
public void CheckChordsDataTestMethod() { IChordRepository _repository; try { _repository = new ChordRepository(_fileDirectory); Assert.IsNotNull(_repository); foreach (Guid witnessChordId in _GUITAR_WITNESS_CHORD_IDS) { Chord c = _repository.Get(witnessChordId); Assert.IsNotNull(c); Assert.IsNotNull(c.Attributes); Assert.IsNotNull(c.Compositions); Assert.AreNotEqual <int>(0, c.Attributes.Count()); Assert.AreNotEqual <int>(0, c.Compositions.Count()); Assert.AreNotEqual <Guid>(Guid.Empty, c.Id); Assert.AreEqual <Guid>(witnessChordId, c.Id); Assert.AreNotEqual <int>(0, c.Attributes.First().Code); c = null; } } catch (Exception ex) { Assert.Fail(ex.Message); } finally { _repository = null; } }
public ChordController(ChordRepository repo) { _repo = repo; }