예제 #1
0
 private static void CreateServices()
 {
     if (!_servicesCreated)
     {
         lock (typeof(CustomServiceHostFactory))
             if (!_servicesCreated)
             {
                 AtlantaServices.ClearServices();
                 AtlantaServices.AddAdvisedService <IMediaService>(new MediaService(), new AopAroundAdvice());
                 _servicesCreated = true;
             }
     }
 }
예제 #2
0
        override public void SetUp()
        {
            base.SetUp();

            AtlantaServices.ClearServices();
            AtlantaServices.AddAdvisedService <IMediaService>(new MediaService(), new AopAroundTestAdvice());

            Library library = Library.InstantiateLibrary();

            Repository.Add(library);

            library.Create(Media.InstantiateOrphanedMedia(MediaType.Book, "Book 1", "A test book"));
            library.Create(Media.InstantiateOrphanedMedia(MediaType.Cd, "CD", "A test cd"));
            library.Create(Media.InstantiateOrphanedMedia(MediaType.Book, "Book 2", "A test book"));

            Repository.Flush();
            Repository.Clear();

            _user = User.InstantiateUser("testServiceUser");
        }