Exemplo n.º 1
0
        public void TestToInternetTrafic_With_WrongData(string input, string multiplier, double output)
        {
            //Act
            var result = MultiplierInternetTrafic.ToInternetTrafic(input, multiplier);

            //Assert
            Assert.AreEqual(output, result);
        }
Exemplo n.º 2
0
        public void TestToInternetTrafic_With_WrongMultiplier(string input, string multiplier)
        {
            //Act
            Exception ex = Assert.Throws <Exception>(() => MultiplierInternetTrafic.ToInternetTrafic(input, multiplier));

            //Assert
            Assert.AreEqual("Wrong multiplier!", ex.Message);

            //2nd way to check
            // Assert.That(() =>
            // {
            //    WinFormsExtensions.ToInternetTrafic(input, multiplier);
            //}, Throws.TypeOf<Exception>().With.Message.EqualTo("Wrong multiplier!"));
        }