public void BuildServiceAdapterPluginTest()
        {
            //Arrange and Act
            BlabService blabService = harness.CreateBlabService();

            //Assert
            Assert.IsTrue(blabService is BlabService);
        }
Ejemplo n.º 2
0
        public void GetAllEmptyTest()
        {
            BlabService blabService = blabServiceFactory.CreateBlabService();
            ArrayList   expected    = new ArrayList();
            IEnumerable actual      = blabService.GetAll();

            Assert.AreEqual(expected.Count, (actual as ArrayList).Count);
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var blabService = new BlabService();
            var userService = new UserService();

            services.AddSingleton <IUserService>(s => userService);
            services.AddSingleton <IBlabService>(s => blabService);
            services.AddRazorPages();
        }
        public void BuildServiceAdapterPluginTest()
        {
            //Arrange and Act
            BlabServiceFactory _harness2   = new BlabServiceFactory();
            BlabService        blabService = _harness2.CreateBlabService();

            //Assert
            Assert.IsTrue(blabService is BlabService);
        }
Ejemplo n.º 5
0
        public void AddNewBlabSuccessTest()
        {
            string      email       = "*****@*****.**";
            string      msg         = "Blab, Blab, Blab";
            BlabService blabService = blabServiceFactory.CreateBlabService();
            Blab        blab        = blabService.CreateBlab(msg, email);

            blabService.AddBlab(blab);
            Blab actual = (Blab)blabService.FindUserBlabs(email);
        }
Ejemplo n.º 6
0
        public void GetAllEmptyTest()
        {
            //Arrange
            BlabService blabService = this.harness.CreateBlabService();
            ArrayList   expected    = new ArrayList();

            //Act
            IEnumerable actual = blabService.GetAll();

            //Assert
            Assert.AreEqual(expected.Count, (actual as ArrayList).Count);
        }
Ejemplo n.º 7
0
        public void AddNewBlabSuccessTest()
        {
            //Arrange
            string      email       = "*****@*****.**";
            string      msg         = "Prow scuttle parrel provost Sail ho shrouds spirits boom mizzenmast yardarm.";
            BlabService blabService = _blabServiceFactory.CreateBlabService();
            Blab        blab        = blabService.CreateBlab(msg, email);

            blabService.AddBlab(blab);
            //Act
            Blab actual = (Blab)blabService.FindUserBlabs(email);
            //Assert
            // Assert.AreEqual(blab.Message, actual.Message);
        }
        public void AddNewBlabTest()
        {
            //Arrange
            string      email       = "*****@*****.**";
            string      msg         = "Prow scuttle parrel provost Sail ho shrouds spirits boom mizzenmast yardarm.";
            BlabService blabService = _blabServiceFactory.CreateBlabService();
            Blab        blab        = blabService.CreateBlab(msg, email);

            blabService.AddBlab(blab);
            //Act
            var actual = Assert.ThrowsException <NotImplementedException>(() => blabService.FindUserBlabs(email));

            //Assert
            Assert.AreEqual("FindUserBlabs", actual.Message);
        }
Ejemplo n.º 9
0
        public void AddNewBlabTest()
        {
            //Arrange
            string      email       = "*****@*****.**";
            string      msg         = "Test Message.";
            BlabService blabService = _blabServiceFactory.CreateBlabService();
            Blab        blab        = blabService.CreateBlab(msg, email);

            blabService.AddBlab(blab);
            //Act
            var actual = Assert.ThrowsException <NotImplementedException>(() => blabService.FindUserBlabs(email));

            //Assert
            Assert.AreEqual("FindUserBlabs", actual.Message);
        }
        // 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();
        }
Ejemplo n.º 11
0
        public void AddNewBlabSuccessTest()
        {
            //Arrange
            string email   = "*****@*****.**";
            string message = "This is just a test. This is only a test. If this weren't a test, then this wouldn't be here would it?";

            BlabService blabService = this.harness.CreateBlabService();
            Blab        blab        = blabService.CreateBlab(message, email);

            blabService.AddBlab(blab);

            //Act
            Blab actual = (Blab)blabService.FindUserBlabs(email)[0];

            //Assert
            Assert.AreEqual(blab.message, actual.message);
        }