Ejemplo n.º 1
0
        public async void ReadItem_NoResultForId()
        {
            var service = BuildService();

            WorkNoteDto result = await service.ReadItemAsync(1234);

            result.Should().BeNull();
        }
Ejemplo n.º 2
0
        public async void ReadItem_HappyPath()
        {
            var service = BuildService();

            WorkNoteDto result = await service.ReadItemAsync(1001);

            result.Should().NotBeNull("Result should not be null");
            result.Title.Should().Be("I did another thing");
            result.Content.Should().Be("Went all right, mostly.  I guess.");
            result.CreatedDate.Year.Should().Be(2019);
        }
Ejemplo n.º 3
0
        public async void CreateItem_NullContent()
        {
            var service = BuildService();

            WorkNoteDto result = await service.CreateItemAsync(new WorkNoteDto
            {
                Title   = "I did this",
                Content = null,
            });

            result.Should().NotBeNull();
            result.Id.Should().BeGreaterThan(0);
            result.Title.Should().Be("I did this");
            result.Content.Should().Be("");
            result.CreatedDate.Day.Should().Be(DateTime.Today.Day);
        }
Ejemplo n.º 4
0
        public async void CreateItem_HappyPath()
        {
            var service = BuildService();

            WorkNoteDto result = await service.CreateItemAsync(new WorkNoteDto
            {
                Title   = "I did this",
                Content = "No issues found",
            });

            result.Should().NotBeNull();
            result.Id.Should().Be(1002);
            result.Title.Should().Be("I did this");
            result.Content.Should().Be("No issues found");
            result.CreatedDate.Day.Should().Be(DateTime.Today.Day);
        }
Ejemplo n.º 5
0
        public async void UpdateItem_Error_ContentNull()
        {
            var service = BuildService();

            WorkNoteDto result = await service.UpdateItemAsync(new WorkNoteDto
            {
                Id      = 1001,
                Title   = "Changed",
                Content = null
            });

            result.Should().NotBeNull();
            result.Id.Should().Be(1001);
            result.Title.Should().Be("Changed");
            result.Content.Should().Be("");
            result.CreatedDate.Year.Should().Be(2019);
        }
Ejemplo n.º 6
0
        public async void CreateItem_TrimWhitespace()
        {
            var service = BuildService();

            WorkNoteDto result = await service.CreateItemAsync(new WorkNoteDto
            {
                Title   = @" 
        I did this   ",
                Content = @" No issues found   
    ",
            });

            result.Should().NotBeNull();
            result.Id.Should().BeGreaterThan(0);
            result.Title.Should().Be("I did this");
            result.Content.Should().Be("No issues found");
            result.CreatedDate.Day.Should().Be(DateTime.Today.Day);
        }