示例#1
0
        public void Init()
        {
            currentStateController = App.Current.StateController;
            SetupClass.SetUp();
            limitationPlayers = new CountLicenseLimitation {
                Enabled = true, Maximum = 10, RegisterName = "RAPlayers"
            };
            limitationPlayers2 = new CountLicenseLimitation {
                Enabled = true, Maximum = 20, RegisterName = "RAPlayers"
            };
            limitationTeams = new CountLicenseLimitation {
                Enabled = true, Maximum = 5, RegisterName = "Teams"
            };
            limitationFeature = new FeatureLicenseLimitation {
                Enabled = true, RegisterName = "Feature 1"
            };
            limitationFeature2 = new FeatureLicenseLimitation {
                Enabled = true, RegisterName = "Feature 1"
            };
            limitationFeatureDisabled = new FeatureLicenseLimitation {
                Enabled = false, RegisterName = "Feature 2"
            };

            mockLicenseManager         = new Mock <ILicenseManager> ();
            mockLicenseStatus          = new Mock <ILicenseStatus> ();
            App.Current.LicenseManager = mockLicenseManager.Object;
            mockLicenseManager.SetupGet(obj => obj.LicenseStatus).Returns(mockLicenseStatus.Object);

            mockStateController = new Mock <IStateController> ();
            mockScreenState     = new Mock <IScreenState> ();
            mockStateController.SetupGet(sc => sc.Current).Returns(mockScreenState.Object);
            App.Current.StateController = mockStateController.Object;
        }
        public void OneTimeSetUp()
        {
            SetupClass.SetUp();
            futureProject = Utils.CreateProject();
            futureProject.CreationDate = DateTime.Parse("12/12/9999");
            pastProject = Utils.CreateProject();
            pastProject.CreationDate = DateTime.Parse("12/12/2000");
            nowProject = Utils.CreateProject();
            nowProject.CreationDate = DateTime.Now;

            projectList = new List <LMProject> {
                futureProject,
                pastProject,
                nowProject
            };

            notLimitedLimitation = new CountLicenseLimitation {
                Count   = 0,
                Enabled = false
            };

            limitedLimitation = new CountLicenseLimitation {
                Count   = 0,
                Enabled = true,
                Maximum = 1
            };

            storageMock = new Mock <IStorage> ();
            App.Current.DatabaseManager          = Mock.Of <IStorageManager> ();
            App.Current.DatabaseManager.ActiveDB = storageMock.Object;
        }
示例#3
0
 public void Reset()
 {
     SetupClass.SetUp();
     try {
         CoreServices.Stop();
     } catch {
     }
 }
        public void OneTimeSetUp()
        {
            SetupClass.SetUp();
            Mock <IGUIToolkit> mockGui = new Mock <IGUIToolkit> ();

            mockGui.SetupGet(g => g.DeviceScaleFactor).Returns(1);
            App.Current.GUIToolkit = mockGui.Object;
        }
        public void OneTimeSetUp()
        {
            SetupClass.SetUp();
            Mock <ILicenseLimitationsService> mockLicenseLimitation = new Mock <ILicenseLimitationsService> ();

            mockLicenseLimitation.Setup(license => license.CanExecute(It.IsAny <string> ())).Returns(true);
            App.Current.LicenseLimitationsService = mockLicenseLimitation.Object;
        }
 public void Reset()
 {
     SetupClass.Initialize();
     try {
         CoreServices.Stop();
     } catch {
     }
 }
示例#7
0
        public void OneTimeSetUp()
        {
            SetupClass.SetUp();
            Mock <IGUIToolkit> mockGuiToolkit = new Mock <IGUIToolkit> ();

            mockGuiToolkit.Setup(m => m.DeviceScaleFactor).Returns(1);
            App.Current.GUIToolkit = mockGuiToolkit.Object;
            eventsFilterController = new Utils.DummyEventsFilterController();
        }
 public void OneTimeSetUp()
 {
     SetupClass.SetUp();
     Scanner.ScanReferencedControllers(App.Current.ControllerLocator);
     mockViewLocator         = new Mock <ILocator <IView> > ();
     mockView                = new Mock <IPanel> ();
     App.Current.ViewLocator = mockViewLocator.Object;
     mockViewLocator.Setup(vl => vl.Retrieve(PlayEditorState.NAME)).Returns(mockView.Object);
 }
示例#9
0
 public void TearDownOnce()
 {
     try {
         File.Delete(file1);
         File.Delete(file2);
     } catch {
     }
     SetupClass.SetUp();
 }
示例#10
0
 public void FixtureSetup()
 {
     SetupClass.SetUp();
     Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);
     // Register the events manager
     eventsController         = new EventsController();
     toolsManager             = new ToolsManager();
     currentLicenseManager    = App.Current.LicenseManager;
     currentLimitationService = App.Current.LicenseLimitationsService;
 }
示例#11
0
        public void OneTimeSetUp()
        {
            SetupClass.SetUp();
            Mock <IGUIToolkit> mockGui = new Mock <IGUIToolkit> ();

            mockGui.SetupGet(g => g.DeviceScaleFactor).Returns(1);
            App.Current.GUIToolkit = mockGui.Object;

            mockDashboardsTemplates = new Mock <ICategoriesTemplatesProvider> ();
            mockTeamTemplates       = new Mock <ITeamTemplatesProvider> ();
            App.Current.CategoriesTemplatesProvider = mockDashboardsTemplates.Object;
            App.Current.TeamTemplatesProvider       = mockTeamTemplates.Object;

            teams = new List <Team> {
                new LMTeam {
                    Name = "1"
                },
                new LMTeam {
                    Name = "2"
                },
                new LMTeam {
                    Name = "3"
                },
                new LMTeam {
                    Name = "4"
                },
                new LMTeam {
                    Name = "5"
                }
            };

            dashboards = new List <Dashboard> {
                new LMDashboard {
                    Name = "1"
                },
                new LMDashboard {
                    Name = "2"
                },
                new LMDashboard {
                    Name = "3"
                },
                new LMDashboard {
                    Name = "4"
                },
                new LMDashboard {
                    Name = "5"
                }
            };

            mockTeamTemplates.SetupGet(tm => tm.Templates).Returns(teams);
            mockDashboardsTemplates.SetupGet(d => d.Templates).Returns(dashboards);
        }
示例#12
0
 public void Delete()
 {
     try {
         foreach (var db in App.Current.DatabaseManager.Databases)
         {
             db.Reset();
         }
         Directory.Delete(tmpPath, true);
     } catch {
     }
     CoreServices.Stop();
     SetupClass.SetUp();
 }
示例#13
0
        public void OneTimeSetUp()
        {
            SetupClass.SetUp();
            Mock <IGUIToolkit> mockGuiToolkit = new Mock <IGUIToolkit> ();

            mockGuiToolkit.Setup(m => m.DeviceScaleFactor).Returns(1);
            App.Current.GUIToolkit = mockGuiToolkit.Object;
            eventsFilterController = new LMEventsFilterController();
            homeTeam = new LMTeamVM {
                Model = LMTeam.DefaultTemplate(2)
            };
            awayTeam = new LMTeamVM {
                Model = LMTeam.DefaultTemplate(3)
            };
        }
示例#14
0
        public void InitDB()
        {
            SetupClass.SetUp();
            string dbPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

            if (Directory.Exists(dbPath))
            {
                Directory.Delete(dbPath, true);
            }
            try {
                storage = new CouchbaseStorageLongoMatch(dbPath, "test-db");
            } catch (Exception ex) {
                throw ex;
            }
            db = storage.Database;
        }
示例#15
0
        public void InitDB()
        {
            SetupClass.SetUp();
            App.Current.DependencyRegistry.Register <IFileStorage, LMDB.FileStorage> (0);
            string dbPath = Path.Combine(Path.GetTempPath(), "TestDB");

            if (Directory.Exists(dbPath))
            {
                Directory.Delete(dbPath, true);
            }
            try {
                storage = new CouchbaseStorageLongoMatch(dbPath, "test-db");
            } catch (Exception ex) {
                throw ex;
            }
            db = storage.Database;
        }
示例#16
0
        public void InitDB()
        {
            SetupClass.SetUp();
            string tmpPath  = Path.GetTempPath();
            string homePath = Path.Combine(tmpPath, "LongoMatch");
            string dbPath   = Path.Combine(homePath, "db");

            if (Directory.Exists(dbPath))
            {
                Directory.Delete(dbPath, true);
            }

            Directory.CreateDirectory(tmpPath);
            Directory.CreateDirectory(homePath);
            Directory.CreateDirectory(dbPath);

            storage = new CouchbaseStorageLongoMatch(dbPath, "test-db");
            db      = ((CouchbaseStorageLongoMatch)storage).Database;
            // Remove the StorageInfo doc to get more understandable document count results
            db.GetDocument(Guid.Empty.ToString()).Delete();

            Environment.SetEnvironmentVariable("LONGOMATCH_HOME", tmpPath);
            Environment.SetEnvironmentVariable("LGM_UNINSTALLED", "1");
        }
示例#17
0
 public void SetUpOnce()
 {
     SetupClass.SetUp();
 }
 public void SetUp()
 {
     SetupClass.SetUp();
     stateControllerMock         = new Mock <IStateController> ();
     App.Current.StateController = stateControllerMock.Object;
 }
示例#19
0
 public void TearDown()
 {
     SetupClass.SetUp();
 }
示例#20
0
 public void Reset()
 {
     SetupClass.SetUp();
 }
 public void Reset()
 {
     SetupClass.Initialize();
 }
示例#22
0
 public void OneTimeSetUp()
 {
     SetupClass.SetUp();
 }
示例#23
0
 public void OneTimeSetUp()
 {
     SetupClass.SetUp();
     mockLimitationService = new Mock <ILicenseLimitationsService> ();
     App.Current.LicenseLimitationsService = mockLimitationService.Object;
 }
示例#24
0
 public void FixtureSetup()
 {
     SetupClass.SetUp();
 }
示例#25
0
 public void OneTimeSetUp()
 {
     SetupClass.SetUp();
     VAS.Drawing.DrawingInit.ScanViews();
 }