public void ReturnsNullWhenButtonIsNotFoundInAppBar() { var bar = new ApplicationBar(); var button1 = new ApplicationBarIconButton(new Uri("/button1.png", UriKind.Relative)); button1.Text = "button1"; var button2 = new ApplicationBarIconButton(new Uri("/button2.png", UriKind.Relative)); button2.Text = "button2"; bar.Buttons.Add(button1); bar.Buttons.Add(button2); ApplicationBarIconButton findButton = bar.FindButton("button3"); Assert.IsNull(findButton); }
public void CanFindApplicationButtonInAppBar() { var bar = new ApplicationBar(); var button1 = new ApplicationBarIconButton(new Uri("/button1.png", UriKind.Relative)); button1.Text = "button1"; var button2 = new ApplicationBarIconButton(new Uri("/button2.png", UriKind.Relative)); button2.Text = "button2"; bar.Buttons.Add(button1); bar.Buttons.Add(button2); ApplicationBarIconButton findButton = bar.FindButton("button1"); Assert.AreEqual(button1, findButton); }