示例#1
0
        public void GetMinutesAndSecound_StringWithH_Test()
        {
            // Arange
            var mathStuff = new MathStuff();

            // Act
            double actualMinutes;
            double actualSecounds;

            mathStuff.GetMinutesAndSecounds("2.56h", out actualMinutes, out actualSecounds);

            var expectedMinutes = 153.6;
            var expectedSecound = 9216D;

            Assert.AreEqual(expectedMinutes, actualMinutes, "Minits not matching.");
            Assert.AreEqual(expectedSecound, actualSecounds, "Secound not matching.");
        }
示例#2
0
        public void GetMinutesAndSecound_VerboseString_Test()
        {
            // Arange
            var mathStuff = new MathStuff();

            // Act
            double actualMinutes;
            double actualSecounds;

            mathStuff.GetMinutesAndSecounds("Five", out actualMinutes, out actualSecounds);
        }
示例#3
0
        public void GetMinutesAndSecound_EmptyString_Test()
        {
            // Arange
            var mathStuff = new MathStuff();

            // Act
            double actualMinutes;
            double actualSecounds;

            mathStuff.GetMinutesAndSecounds(string.Empty, out actualMinutes, out actualSecounds);
        }
示例#4
0
        public void GetMinutesAndSecound_NullValue_Test()
        {
            // Arange
            var mathStuff = new MathStuff();

            // Act
            double actualMinutes;
            double actualSecounds;

            mathStuff.GetMinutesAndSecounds(null, out actualMinutes, out actualSecounds);
        }
示例#5
0
        public void GetMinutesAndSecound_ComplexStringTest_Test()
        {
            // Arange
            var mathStuff = new MathStuff();

            // Act
            double actualMinutes;
            double actualSecounds;

            mathStuff.GetMinutesAndSecounds("   2 000.56 h   ", out actualMinutes, out actualSecounds);

            var expectedMinutes = 120033.6;
            var expectedSecound = 7202016D;

            Assert.AreEqual(expectedMinutes, Math.Round(expectedMinutes,2, MidpointRounding.AwayFromZero ), "Minits not matching.");
            Assert.AreEqual(expectedSecound, Math.Round(expectedSecound,2, MidpointRounding.AwayFromZero), "Secound not matching.");
        }
示例#6
0
        public void GetMinutesAndSecound_StringWithThousenSeparator_Test()
        {
            // Arange
            var mathStuff = new MathStuff();

            // Act
            double actualMinutes;
            double actualSecounds;

            mathStuff.GetMinutesAndSecounds("2 000.56", out actualMinutes, out actualSecounds);

            var expectedMinutes = 120033.6D;
            var expectedSecound = 7202016D;

            Assert.AreEqual(expectedMinutes, actualMinutes, "Minits not matching.");
            Assert.AreEqual(expectedSecound, actualSecounds, "Secound not matching.");
        }