Example #1
0
        public void TestBinToIntConvrter_ConvertsToByte(string input, byte expected)
        {
            var c = new BinToIntConvertService();
            var r = c.ToByte(input);

            Assert.IsType <byte>(r);
            Assert.Equal(expected, r);
        }
Example #2
0
        public void TestBinToIntConvrter_ConvertFails()
        {
            var c = new BinToIntConvertService();

            Assert.Throws <FormatException>(() => c.ToByte("invalid bin"));
        }