예제 #1
0
        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"));
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
 public ChordController(ChordRepository repo)
 {
     _repo = repo;
 }