ToString() public method

public ToString ( ) : string
return string
Exemplo n.º 1
0
        public void ToString_GiveStringAndValue_ReturnsStringAndValue()
        {
            //Arrange
            string expected = "Number of players: {0}";
            var rolloverUtility = new RolloverUtility(1, 1, 2);
            var mainMenuItem = new MenuItem(expected, rolloverUtility);

            //Act
            var result = mainMenuItem.ToString();

            //Assert
            Assert.AreEqual("Number of players: 1",result);
        }
Exemplo n.º 2
0
        public void ToString_GiveString_ReturnsString()
        {
            //Arrange
            string expected = "Number of players: {0}";
            var mainMenuItem = new MenuItem(expected);

            //Act
            var result = mainMenuItem.ToString();

            //Assert
            Assert.AreEqual(expected,result);
        }