public void Count_WrittenMethod_Test() { var words = new List <IRecord> { new Record { Id = 1, Word = "Bob", UserReport = 1 }, new Record { Id = 2, Word = "made", UserReport = 1 }, new Record { Id = 3, Word = "abracadabra", UserReport = 5 }, new Record { Id = 4, Word = "meany", UserReport = 2 }, new Record { Id = 5, Word = "margeaux", UserReport = 2 }, new Record { Id = 5, Word = "really", UserReport = 2 }, }; var counterService = new CounterService(); var target = counterService.Count(words, ModelSelection.Written); Assert.True(target[0].WrittenMethodGuess == 1); Assert.True(target[1].WrittenMethodGuess == 1); Assert.True(target[2].WrittenMethodGuess == 5); Assert.True(target[3].WrittenMethodGuess == 2); Assert.True(target[4].WrittenMethodGuess == 2); Assert.True(target[5].WrittenMethodGuess == 2); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. Button.AccessibilityIdentifier = "myButton"; Button.TouchUpInside += delegate { _service.Count(); Button.SetTitle(_service.Message, UIControlState.Normal); Button.SetTitleColor(_service.MessageColor, UIControlState.Normal); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button button = FindViewById <Button>(Resource.Id.myButton); button.Click += delegate { _service.Count(); button.Text = _service.Message; }; }