Exemplo n.º 1
0
        public async Task UpdatesTheEntityWithASoftDeletedEntity()
        {
            await InteractorFactory.DeleteTimeEntry(timeEntry.Id).Execute();

            await DataSource.TimeEntries.Received().SoftDelete(
                Arg.Is <IThreadSafeTimeEntry>(timeEntry));
        }
            public void DeletesTheTimeEntry(long id)
            {
                var timeEntry = Substitute.For <IThreadSafeTimeEntry>();

                timeEntry.Id.Returns(id);
                timeEntry.Duration.Returns(100);
                timeEntry.WorkspaceId.Returns(10);
                var timeEntryViewModel = new TimeEntryViewModel(timeEntry, DurationFormat.Improved);

                ViewModel.DeleteCommand.ExecuteAsync(timeEntryViewModel).Wait();

                InteractorFactory.Received().DeleteTimeEntry(Arg.Is(id));
                InteractorFactory.DeleteTimeEntry(timeEntry.Id).Received().Execute();
            }