示例#1
0
        public async Task When_UpdateByIdAsync()
        {
            // Arrange

            var toDoData =
                new ToDoData
            {
                Description = _faker.Lorem.Paragraph(1)
            };

            toDoData.ToDoId =
                toDoData.Id;

            await _toDoDataContainer.CreateItemAsync(
                toDoData,
                new PartitionKey(toDoData.Id));

            toDoData.Description = _faker.Lorem.Paragraph(1);

            // Action

            await _toDoDataStore.UpdateByIdAsync(
                toDoData.Id,
                toDoData);

            // Assert

            toDoData =
                await _toDoDataContainer.ReadItemAsync <ToDoData>(
                    toDoData.Id,
                    new PartitionKey(toDoData.Id));

            toDoData.Should().NotBeNull();
        }
示例#2
0
        public async Task When_GetByIdAsync()
        {
            // Arrange

            var toDoData =
                new ToDoData
            {
                Description = _faker.Lorem.Paragraph(1)
            };

            await _toDoDataContainer.CreateItemAsync(
                toDoData,
                new PartitionKey(toDoData.Id));

            // Action

            toDoData =
                await _toDoDataStore.GetByIdAsync(
                    toDoData.Id);

            // Assert

            toDoData.Should().NotBeNull();
        }