Beispiel #1
0
        public void DocumentNew()
        {
            BizService.BizService service = GetService();

            Doc doc = service.DocumentNew(Guid.NewGuid());

            Assert.IsNotNull(doc);
        }
 public void BizServiceEmptyConstructor()
 {
     using (var bizService = new BizService.BizService("D"))
     {
         var userInfo = bizService.GetUserInfo();
         Assert.IsNotNull(userInfo);
         Console.WriteLine(userInfo.OrganizationName, userInfo.UserName);
     }
     Console.WriteLine("OK");
 }
Beispiel #3
0
        public void DocumentSave()
        {
            BizService.BizService service = GetService();

            var docForSave = new Doc();

            Doc doc = service.DocumentSave(docForSave);

            Assert.IsNotNull(doc);
        }
        public void AppServiceProviderTest()
        {
            using (var connection = new SqlConnection(ConnectionString))
            {
                using (var dataContext = new DataContext(connection))
                {
                    //AppServiceProvider.SetServiceFactoryFunc(typeof (IUserRepository), CreateFakeUserRepository);
                    using (var multiDc = new MultiDataContext(new[] { dataContext }))
                    {
                        var service = new BizService.BizService(multiDc, "D");
                        try
                        {
                            Console.WriteLine(@"Count of AppServiceProvider Factory functions: {0}",
                                              AppServiceProvider.TypeFactoryFuncs.Count);
                            Console.WriteLine(@"Count of Services in AppServiceProvider: {0}",
                                              service.Provider.GetServiceCount());

                            Assert.IsNotNull(service);
                            service.TryConnect();
                        }
                        finally
                        {
                            service.Dispose();
                        }
                        service = new BizService.BizService(service.Provider, "D");
                        try
                        {
                            Console.WriteLine(@"Count of AppServiceProvider Factory functions: {0}",
                                              AppServiceProvider.TypeFactoryFuncs.Count);
                            Console.WriteLine(@"Count of Services in AppServiceProvider: {0}",
                                              service.Provider.GetServiceCount());

                            Assert.IsNotNull(service);

                            var userInfo = service.GetUserInfo();
                            Assert.IsNotNull(userInfo);
                            Console.WriteLine(userInfo.OrganizationName);
                            foreach (var l in service.GetLanguages())
                            {
                                Console.Write(l.Name, " ");
                            }
                        }
                        finally
                        {
                            service.Dispose();
                        }
                    }
                }
            }
        }
Beispiel #5
0
        public void DocumentDelete()
        {
            BizService.BizService service = GetService();

            service.DocumentDelete(Guid.NewGuid());
        }