Esempio n. 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");
            }
        }
Esempio n. 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");
            }
        }
Esempio n. 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);
                }
            }
        }