public void GetAllEmptyTest()
        {
            UserService userService = userServiceFactory.CreateUserService();
            ArrayList   expected    = new ArrayList();
            IEnumerable actual      = userService.GetAll();

            Assert.AreEqual(expected.Count, (actual as ArrayList).Count);
        }
Пример #2
0
        public void BuildServiceAdapterPluginTest()
        {
            //Arrange and Act
            UserService userService = harness.CreateUserService();

            //Assert
            Assert.IsTrue(userService is UserService);
        }
        public void BuildServiceAdapterPluginTest()
        {
            //Arrange and Act
            UserServiceFactory _harness2   = new UserServiceFactory();
            UserService        userService = _harness2.CreateUserService();

            //Assert
            Assert.IsTrue(userService is UserService);
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            UserServiceFactory userServiceFactory = new UserServiceFactory();
            IUserPlugin        userPlugin         = userServiceFactory.CreateUserPlugin("mysql");
            UserAdapter        userAdapter        = userServiceFactory.CreateUserAdapter(userPlugin);
            UserService        userService        = userServiceFactory.CreateUserService(userAdapter);

            services.AddSingleton <IUserService>(s => userService);
            services.AddRazorPages();
        }
        public void GetAllEmptyTest()
        {
            //Arrange
            UserServiceFactory _userServiceFactory = new UserServiceFactory();
            UserService        userService         = _userServiceFactory.CreateUserService();
            ArrayList          expected            = new ArrayList();
            //Act
            IEnumerable actual = userService.GetAll();

            //Assert
            Assert.AreEqual(expected.Count, (actual as ArrayList).Count);
        }
        public void AddNewUserSuccessTest()
        {
            //Arrange
            UserServiceFactory _userServiceFactory = new UserServiceFactory();
            string             email       = "*****@*****.**";
            UserService        userService = _userServiceFactory.CreateUserService();
            User expected = userService.CreateUser(email);

            userService.AddNewUser(email);
            //Act
            User actual = userService.FindUser(email);

            //Assert
            Assert.AreEqual(expected.Email, actual.Email);
        }
Пример #7
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            UserServiceFactory userServiceFactory = new UserServiceFactory();
            iUserPlugin        userPlugin         = userServiceFactory.CreateUserPlugin("mysql");
            UserAdapter        userAdapter        = userServiceFactory.CreateUserAdapter(userPlugin);
            UserService        userService        = userServiceFactory.CreateUserService(userAdapter);

            BlabServiceFactory blabServiceFactory = new BlabServiceFactory();
            iBlabPlugin        blabPlugin         = blabServiceFactory.CreateBlabPlugin("mysql");
            BlabAdapter        blabAdapter        = blabServiceFactory.CreateBlabAdapter(blabPlugin);
            BlabService        blabService        = blabServiceFactory.CreateBlabService(blabAdapter);

            services.AddSingleton <iUserService>(s => userService);
            services.AddSingleton <iBlabService>(s => blabService);
            services.AddRazorPages();
        }
Пример #8
0
        public void BuildServiceAdapterPluginTest()
        {
            var userService = harness.CreateUserService();

            Assert.IsTrue(userService is UserService);
        }