Пример #1
0
        public async Task ExecuteLocal_CallsLocalStore()
        {
            var store = new Mock <IOfflineStore>();

            store.Setup(x => x.DeleteAsync("test", It.IsAny <IEnumerable <string> >(), It.IsAny <CancellationToken>())).Returns(Task.CompletedTask);

            var sut = new DeleteOperation("test", "1234")
            {
                Item = testObject
            };
            await sut.ExecuteOperationOnOfflineStoreAsync(store.Object, testObject);

            Assert.Single(store.Invocations);
            string[] ids = store.Invocations[0].Arguments[1] as string[];
            Assert.Single(ids);
            Assert.Equal("1234", ids[0]);
        }