public void op_TranslateEnglishToFrench_WhenWordNotFoundInDictionary_string()
        {
            // Arrange
            const string englishword = "anything";
            const string expected = "Lundi";

            // Act
            var actual = new PaulController().TranslateEnglishToFrench(englishword);

            // Assert
            Assert.IsNull(actual);
        }
        public void op_TranslateEnglishToFrench_WhenWordIsFoundInDictionary_string()
        {
            // Arrange
            const string englishword = "Monday";
            const string expected = "Lundi";

            // Act
            var actual = new PaulController().TranslateEnglishToFrench(englishword);

            // Assert
            Assert.AreEqual(expected, actual);
        }
        public void op_Translate_Post_WhenModelStateIsNotValid()
        {
            // Arrange
            const string expectedview = "Translate";
            PaulController controller = new PaulController();
            controller.ModelState.AddModelError("From", "Error found");

            // Act
            var result = (ViewResult)controller.Translate(new TranslateViewModel());

            // Assert
            Assert.IsInstanceOfType(result, typeof(ViewResult));
            Assert.AreEqual(expectedview, result.ViewName);
            Assert.AreEqual(1, result.ViewData.ModelState.Keys.Count);
        }
        public void op_Translate_Post_WhenModelStateIsValid()
        {
            // Arrange
            const string englishword = "Monday";
            const string expected = "Lundi";
            const string expectedview = "Translate";
            PaulController controller = new PaulController();
            var result = (ViewResult)controller.Translate(new TranslateViewModel() { From = englishword });
            var model = (TranslateViewModel)result.Model;

            // Act
            var actual = model.To;

            // Assert
            Assert.IsInstanceOfType(result, typeof (ViewResult));
            Assert.AreEqual(expectedview, result.ViewName);
            Assert.AreEqual(expected, actual);
        }