Exemplo n.º 1
0
        public void WhenChordsMethodIsCalled_ThenAllChordDataIsReturned()
        {
            // Arrange
            var controller = new ChordDataController(this.chordData, this.loggerMock.Object);

            // Act
            var chordsObject = controller.Chords();

            // Assert
            Assert.IsNotNull(chordsObject);
            var chordsArray = chordsObject as Chord[] ?? chordsObject.ToArray();

            Assert.AreEqual(53, chordsArray.Length);
            Assert.IsInstanceOfType(chordsArray.First(), typeof(Chord));
        }
Exemplo n.º 2
0
        public void WhenChordsMethodIsCalledWithMultipleSearchTerms_ThenMatchingChordDataIsReturned()
        {
            // Arrange
            var controller = new ChordDataController(this.chordData, this.loggerMock.Object);

            // Act
            var chordsObject = controller.Chords("maj 7th");

            // Assert
            Assert.IsNotNull(chordsObject);
            var chordsArray = chordsObject as Chord[] ?? chordsObject.ToArray();

            Assert.AreEqual(8, chordsArray.Length);
            Assert.AreEqual("Major 7th", chordsArray.First().Description);
            Assert.AreEqual("Major 7th Suspended 4th", chordsArray.Last().Description);
        }