Пример #1
0
        public void TestReflection()
        {
            using (var uow = new TestUnitOfWork())
            {
                Assert.IsNotNull(uow.Repository <User, UserDTO>(), "uow.Users != null by reflection");
                Assert.IsNotNull(uow.Repository <Role, RoleDTO>(), "uow.Roles != null by reflection");

                Assert.IsNotNull(uow.Users, "uow.Users != null");
                Assert.IsNotNull(uow.Roles, "uow.Roles != null");
            }
        }
Пример #2
0
        public void TestReflection()
        {
            using (var uow = new TestUnitOfWork())
            {
                Console.WriteLine(uow.UserRolesRegistered);

                Assert.IsNotNull(uow.Repository <User, UserDTO>(), "uow.Users != null by reflection");
                Assert.IsNotNull(uow.Repository <Role, RoleDTO>(), "uow.Roles != null by reflection");
                Assert.IsNotNull(uow.Repository <UserRole, UserRoleDTO>(), "uow.UserRoles != null by reflection");

                Assert.IsNotNull(uow.Users, "uow.Users != null");
                Assert.IsNotNull(uow.Roles, "uow.Roles != null");
                Assert.IsNotNull(uow.UserRoles, "uow.UserRoles != null");
            }
        }
Пример #3
0
        public void TestDoubleRepository()
        {
            var stopwatch = new Stopwatch();

            stopwatch.Start();

            using (var uow = new TestUnitOfWork())
            {
                var numbers = uow.Repository <DoubleValue, FloatValue>().AllBuilt();
                stopwatch.Stop();
                Console.WriteLine(stopwatch.ElapsedMilliseconds);
                foreach (var number in numbers)
                {
                    Console.WriteLine(number.Value);
                }
            }
        }