public async Task IncrementCounter_AAA_AAAIsAlreadyRegistered_IncrementAAACounter()
        {
            // Arrange
            service.Setup(s => s.GetAllCounters()).ReturnsAsync(new List <Counter>()
            {
                new Counter("AAA")
            });
            // Act
            await controller.IncrementCounter("AAA");

            // Assert
            service.Verify(s => s.IncrementCount(It.Is <Counter>(c => c.Name.Equals("AAA"))));
            service.Verify(s => s.GetAllCounters());
            messenger.Verify(m => m.PostMessage(It.IsAny <CountersChangedMessage>()));
        }
Пример #2
0
        private async void _incrementButton_Click(object sender, EventArgs e)
        {
            var selectedItem = _countersListBox.SelectedItem;

            if (selectedItem == null)
            {
                return;
            }
            var counterName = selectedItem.ToString().Split('\t')[1];
            await controller.IncrementCounter(counterName);
        }