public static void InitTestClass(TestContext testContext)
        {
            // Init users entities
            UserEntities.Add(new UserEntity()
            {
                Id = Guid.NewGuid(), Username = "******", Password = "******"
            });
            UserEntities.Add(new UserEntity()
            {
                Id = Guid.NewGuid(), Username = "******", Password = "******"
            });


            // Init gallery entities
            GalleryEntities.Add(new GalleryEntity()
            {
                Id = Guid.NewGuid(), fk_owner = UserEntities[0].Id, Name = "TestName1"
            });
            GalleryEntities.Add(new GalleryEntity()
            {
                Id = Guid.NewGuid(), fk_owner = UserEntities[0].Id, Name = "TestName2"
            });


            // Init image entities
            ImageEntities.Add(new ImageEntity()
            {
                Id = Guid.NewGuid(), fk_gallery = GalleryEntities[0].Id, gallery = GalleryEntities[0], Name = "Test1", Extension = ".jpg", SizeInBytes = 100
            });


            // Mock gallery service
            GalleryService = MockFactory.CreateGalleryServiceMock(GalleryEntities, ImageEntities);
        }
Esempio n. 2
0
        public void InitBeforeEachTest()
        {
            UserEntities    = new List <UserEntity>();
            GalleryEntities = new List <GalleryEntity>();
            ImageEntities   = new List <ImageEntity>();

            // Init users entities
            UserEntities.Add(new UserEntity()
            {
                Id = Guid.NewGuid(), Username = "******", Password = "******"
            });
            UserEntities.Add(new UserEntity()
            {
                Id = Guid.NewGuid(), Username = "******", Password = "******"
            });


            // Init gallery entities
            GalleryEntities.Add(new GalleryEntity()
            {
                Id = Guid.NewGuid(), fk_owner = UserEntities[0].Id, Name = "TestName1"
            });
            GalleryEntities.Add(new GalleryEntity()
            {
                Id = Guid.NewGuid(), fk_owner = UserEntities[0].Id, Name = "TestName2"
            });


            // Init image entities
            ImageEntities.Add(new ImageEntity()
            {
                Id = Guid.NewGuid(), fk_gallery = GalleryEntities[0].Id, gallery = GalleryEntities[0], Name = "Test1", Extension = ".jpg", SizeInBytes = 100
            });


            // Mock gallery service
            GalleryService = MockFactory.CreateGalleryServiceMock(GalleryEntities, ImageEntities);


            // Mock image service
            ImageService = MockFactory.CreateImageServiceMock(ImageEntities);
        }