Exemplo n.º 1
0
        public static void AppUsersCanBeQueriedTest()
        {
            IT.Load();
            List <AppUser> someUsers = GetTestUsers();

            var repo   = new AppUsersRepository(someUsers);
            var aUser  = repo.FirstOrDefault(u => u.FirstName == "Bob");
            var supers = repo.GetAll().Where(u => u.SecurityLevel > 1024).ToList();

            // Assert..
            if (supers.Count != 1 || supers.Single(u => u.FullName == "Chuck Norris") == null)
            {
                throw new InvalidOperationException();
            }

            if (aUser == null || aUser.FirstName != "Bob")
            {
                throw new InvalidOperationException();
            }

            if (aUser != repo.GetById(aUser.Id))
            {
                throw new InvalidOperationException();
            }
        }
Exemplo n.º 2
0
        public T Get <T>(string key, string section = null, T defaultValue = default(T))
        {
            var id = IT.Id;

            Debug.WriteLine("tasst");
            Trace.TraceInformation("Configuration instance has id " + Id);
            Trace.TraceInformation("Configuration instance reports singleton It.Instance Id of " + id);

            base.Load();
            this.Load();
            IT.Load();

            return(default(T));
        }
Exemplo n.º 3
0
 static It()
 {
     IT.Load();
 }