public void Download_CallWithLei_ReturnsCorrectProperties()
        {
            var character = "lei";
            // Arrange
            var htmlMock = new Mock <IHtmlWebWrapper>();

            htmlMock.Setup(doc => doc.GetHtmlDocument(It.IsAny <string>())).Returns(LoadDocument(character));

            var sut = new RbnorwayScraper(htmlMock.Object);

            var expectedInput           = "3";
            var expectedHitLevel        = "h";
            var expectedDamage          = "30";
            var expectedStartUp         = "15";
            var expectedBlockFrame      = "-9";
            var expectedHitFrame        = "-4";
            var expectedCounterHitFrame = "-2";
            var expectedNotes           = "Tail spin";

            // Act
            var data   = sut.Download(character);
            var actual = data.Moves.FirstOrDefault(m => m.Input == expectedInput);

            //Assert
            Assert.Equal(expectedInput, actual.Input);
            Assert.Equal(expectedHitLevel, actual.HitLevel);
            Assert.Equal(expectedDamage, actual.Damage);
            Assert.Equal(expectedStartUp, actual.StartUp);
            Assert.Equal(expectedBlockFrame, actual.BlockFrame);
            Assert.Equal(expectedHitFrame, actual.HitFrame);
            Assert.Equal(expectedCounterHitFrame, actual.CounterHitFrame);
            Assert.Equal(expectedNotes, actual.Properties);
        }
        public void Download_CallWithJosie_ReturnsCorrectCount()
        {
            // Arrange
            var htmlMock = new Mock <IHtmlWebWrapper>();

            htmlMock.Setup(doc => doc.GetHtmlDocument((It.IsAny <string>()))).Returns(LoadDocument("josie"));

            var sut = new RbnorwayScraper(htmlMock.Object);

            // Act
            var moveData = sut.Download("josie").Moves;

            //Assert
            Assert.Equal(101, moveData.Count());
        }
        public void Download_CallWithCharacterName_CallsHtmlWebWrapper(string character)
        {
            // Arrange
            var htmlMock = new Mock <IHtmlWebWrapper>();

            htmlMock.Setup(doc => doc.GetHtmlDocument(It.IsAny <string>())).Returns(LoadDocument(character));

            var rbnorwayDownloader = new RbnorwayScraper(htmlMock.Object);

            // Act
            rbnorwayDownloader.Download(character);

            //Assert
            htmlMock.Verify(h => h.GetHtmlDocument(It.Is <string>(s => s.Contains(character))));
        }
        public void Download_CallCharacters_NoHeader(string character)
        {
            // Arrange
            var htmlMock = new Mock <IHtmlWebWrapper>();

            htmlMock.Setup(doc => doc.GetHtmlDocument((It.IsAny <string>()))).Returns(LoadDocument(character));

            var sut = new RbnorwayScraper(htmlMock.Object);

            // Act
            var moveData = sut.Download(character).Moves;

            //Assert
            Assert.Empty(moveData.Where(m => m.Input == "Command"));
        }
        public void Download_CallCharacters_NoNullPropertyObjectsReturned(string character)
        {
            // Arrange
            var htmlMock = new Mock <IHtmlWebWrapper>();

            htmlMock.Setup(doc => doc.GetHtmlDocument((It.IsAny <string>()))).Returns(LoadDocument(character));

            var sut = new RbnorwayScraper(htmlMock.Object);

            // Act
            var moveData = sut.Download(character).Moves;

            //Assert
            Assert.Empty(moveData.Where(m => String.IsNullOrWhiteSpace(m.Input)));
        }
        public void Download_CallWithCharacterName_ReturnsNonEmptyObject(string character)
        {
            // Arrange
            var htmlMock = new Mock <IHtmlWebWrapper>();

            htmlMock.Setup(doc => doc.GetHtmlDocument(It.IsAny <string>())).Returns(LoadDocument(character));

            var sut = new RbnorwayScraper(htmlMock.Object);

            // Act
            var data = sut.Download(character);

            //Assert
            Assert.NotNull(data.Name);
            Assert.True(data.Moves.Any());
        }