public async Task AddNewCounter_AAA_SaveToRepositoryAndReturnTrue()
        {
            // Act
            var result = await service.AddNewCounter("AAA");

            // Assert
            repository.Verify(r => r.SaveOrReplace(It.Is <Counter>(c => c.Name.Equals("AAA"))));
            Assert.IsTrue(result);
        }
示例#2
0
 public async Task AddNewCounter(string counterName)
 {
     if (await counterService.AddNewCounter(counterName) == false)
     {
         return;
     }
     messenger.PostMessage(await CreateCountersChangedMessage());
 }
示例#3
0
 async Task Save()
 {
     if (counter.Id == null)
     {
         await service.AddNewCounter(counter.Account, counter.Password);
     }
     else
     {
         await service.UpdateAccount(counter);
     }
     await navigationService.Close(this);
 }
示例#4
0
        async Task Save() //Adds a new counter and then closes the view model
        {
            await service.AddNewCounter(counter.Name);

            await navigationService.Close(this);
        }
示例#5
0
        async Task Save()
        {
            await service.AddNewCounter(counter.Name);

            await navigationService.Close(this);
        }
示例#6
0
        async Task Save()
        {
            await service.AddNewCounter(counter.Name);

            navigationService.GoBack();
        }