Esempio n. 1
0
        public void DetailsShouldReturnNotFound_WhenIdNotFound()
        {
            var query = new GetPathDetailsQuery()
            {
                Id = 99999
            };

            FluentActions.Invoking(() =>
                                   SendAsync(query)).Should().ThrowAsync <NotFoundException>();
        }
Esempio n. 2
0
        public async Task ShouldReturnPathWithModules()
        {
            var path = await AddAsync(new Path
            {
                Title       = "Some Other Path",
                Key         = "some-path",
                Description = "Some Other Path Description",
                Modules     = new List <Module>
                {
                    new Module {
                        Title = "Module1", Key = "module-key-1", Description = "Module 1 Description", Necessity = Necessity.Other
                    },
                    new Module {
                        Title = "Module2", Key = "module-key-2", Description = "Module 2 Description", Necessity = Necessity.GoodToKnow
                    },
                    new Module {
                        Title = "Module3", Key = "module-key-3", Description = "Module 3 Description", Necessity = Necessity.Interesting
                    },
                    new Module {
                        Title = "Module4", Key = "module-key-4", Description = "Module 4 Description", Necessity = Necessity.MustKnow
                    },
                    new Module {
                        Title = "Module5", Key = "module-key-5", Description = "Module 5 Description", Necessity = Necessity.Possibility
                    }
                },
                Tags = new List <string> {
                    "Tag1", "Tag2", "Tag3"
                }
            });

            var query = new GetPathDetailsQuery()
            {
                Id = path.Id
            };

            var result = await SendAsync(query);

            result.Title.Should().NotBeEmpty();
            result.Modules.Should().HaveCount(5);
            result.Tags.Should().HaveCount(3);
        }