public void RaiseValue_RolloverUtilityNull_DoesNotThrowNullReferenceException() { //Arrange string text = "some string"; var mainMenuItem = new MenuItem(text); //Act mainMenuItem.RaiseValue(); //Assert }
public void GetValue_RolloverUtilityNull_ThrowsNullReferenceException() { //Arrange string text = "START THE GAME"; var mainMenuItem = new MenuItem(text); //Act mainMenuItem.GetValue(); //Assert }
protected override void Initilize() { RolloverUtility = new RolloverUtility(0, 0, 1); MenuItems = new MenuItem[2]; MenuItems[0] = new MenuItem("Continue", RolloverUtility); MenuItems[1] = new MenuItem("Main Menu", RolloverUtility); instructionsPositionX = 5; instructionsPositionY = 47; Description = "Controls: \nConfirm = Enter \nSelect a value = Up & Down"; }
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); }
protected override void Initilize() { RolloverUtility = new RolloverUtility(0, 0, 3); MenuItems = new MenuItem[4]; MenuItems[0] = new MenuItem("Number of players: {0}", new RolloverUtility(1, 1, 2)); MenuItems[1] = new MenuItem("Number of bots: {0}", new RolloverUtility(2, 0, 3)); MenuItems[2] = new MenuItem("Selected map: {0}", new RolloverUtility(0, 0, 4)); MenuItems[3] = new MenuItem("Number of laps: {0}", new RolloverUtility(1, 1, 9)); instructionsPositionX = 5; instructionsPositionY = 5; Description = "Controls: \nQuit game = Escape \nStart game = Enter \nSelect a value = Up & Down \nChange selected value = Left & Right \nToggle fullscreen = F"; Credits = "Credits:\nChristoffer\nEmil\nFredrik\nMagnus\nManuel\nMattias\nPhilip\nTobias"; }
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); }