Esempio n. 1
0
        public void ShouldGetAPersonList()
        {
            //Arrange
            //Todo: How to fix person dependency in order to get random profile images and lorem ipsum text of names ?
            PersonEngine     personEngine = new PersonEngine();
            ImageEngine      imageEngine  = new ImageEngine(new LoremPixelProvider());
            LoremIpsumEngine textEngine   = new LoremIpsumEngine(new PersonNamesProvider());

            string[] text = textEngine.Create(1).AsParagraph().Split(' ');


            //Act
            List <Person> personList = personEngine.Create(1);

            //Assert

            List <Person> testList = new List <Person> {
                new Person {
                    FirstName = text[0], LastName = text[1], Image = imageEngine.Create()
                }
            };


            Assert.AreEqual(testList, personList);
        }
Esempio n. 2
0
        public void ShouldCreateAnImageGallery()
        {
            //Arrange
            LoremPixelProvider loremPixel = new LoremPixelProvider();
            int expectedCount             = 10;
            //Act
            ImageGallery gallery = _imageGalleryEngine.Create(expectedCount, null);

            //Assert
            Assert.AreEqual(gallery.Items.Count(), expectedCount);
        }
        public DefaultServices()
        {
            ImageEngine imageEngine = new ImageEngine(new LoremPixelProvider());

            Get["/images"] = _ => JsonConvert.SerializeObject(imageEngine.Create(10, null));
        }