コード例 #1
0
        public void GetAllUsers_Controller()
        {
            const int User_COUNT = 10;

            var queryObject = new UserQuery() { };
            var testElement = MockingTools.CreateBasicSetup(User_COUNT);

            var result = testElement.user_controller.Get(queryObject);

            Assert.AreEqual(User_COUNT, result.Count());
        }
コード例 #2
0
        public void GetUserByCreateDate_Controller()
        {
            const int User_COUNT = 10;
            DateTime User_CREATE = MockingTools.CreateDateTime(1);

            var queryObject = new UserQuery() { CreatedDate = User_CREATE };

            var testElement = MockingTools.CreateBasicSetup(User_COUNT);
            var result = testElement.user_controller.Get(queryObject);

            Assert.AreEqual(1, result.Count());
            Assert.AreEqual(result.ElementAt(0).CreatedDate, User_CREATE);
        }
コード例 #3
0
        public void GetUserById_Controller()
        {
            const int User_COUNT = 10;

            var queryObject = new UserQuery() { UserId = 1 };

            var testElement = MockingTools.CreateBasicSetup(User_COUNT);

            var result = testElement.user_controller.Get(queryObject);

            Assert.AreEqual(1, result.Count());
            Assert.AreEqual(result.ElementAt(0).UserId, 1);
        }
コード例 #4
0
        public void GetUserByName_Controller()
        {
            const int User_COUNT = 10;
            string User_EMAIL = MockingTools.CreateUserEmail(1);

            var queryObject = new UserQuery() { Email = User_EMAIL };

            var testElement = MockingTools.CreateBasicSetup(User_COUNT);
            var result = testElement.user_controller.Get(queryObject);

            Assert.AreEqual(1, result.Count());
            Assert.AreEqual(result.ElementAt(0).Email, User_EMAIL);
        }