Beispiel #1
0
 public void Setup()
 {
     testDir = TempDirectoriesFactory.CreateEmpty();
     this.pathDaily = Path.Combine(testDir.AbsolutePath, "_event.2014-01-01.txt");
     this.pathMonthly = Path.Combine(testDir.AbsolutePath, "_event.2014-01.txt");
     monthlyWriter = new LogWriter(pathDaily, new DateTime(2014, 1, 1), false);
     dailyWriter = new LogWriter(pathMonthly, new DateTime(2014, 1, 1), false);
 }
Beispiel #2
0
        public virtual void Setup()
        {
            Fixture.HttpWebRequestsMock.Arrange(requests => requests.GetResponseAsync(Arg.IsAny<string>()))
                   .Throws<NotSupportedException>();

            HtmlWebRequestsDir =
                TempDirectoriesFactory.CreateByUnzippingFile(Path.Combine(TestPaksZippedDirFullPath,
                    "WurmServerTests-wurmdir-webrequests.7z"));

            ClientMock.PopulateFromZip(Path.Combine(TestPaksZippedDirFullPath, "WurmServerTests-wurmdir.7z"));

            Timescope = TimeStub.CreateStubbedScope();
            Timescope.SetAllLocalTimes(MockedNow);
        }
        public void Setup()
        {
            wurmApiConfig = new WurmApiConfig {Platform = Platform.Linux};

            system = new LogFileStreamReaderFactory(wurmApiConfig);

            ubuntuDir = TempDirectoriesFactory.CreateByUnzippingFile(Path.Combine(TestPaksZippedDirFullPath,
                "ubuntu-wurm-dir.7z"));

            sampleLogFilePath = Path.Combine(ubuntuDir.AbsolutePath,
                "players",
                "aldur",
                "logs",
                "_Event.2015-08.txt");
        }
Beispiel #4
0
        public WurmClientMock([NotNull] DirectoryHandle dir, bool createBasicDirs, Platform targetPlatform)
        {
            if (dir == null) throw new ArgumentNullException("dir");
            this.dir = dir;
            this.targetPlatform = targetPlatform;

            var dirinfo = new DirectoryInfo(dir.AbsolutePath);
            WurmDir = dirinfo.CreateSubdirectory("wurm");

            if (createBasicDirs)
            {
                CreateBasicDirectories();
            }

            InstallDirectory = Mock.Create<IWurmInstallDirectory>();
            InstallDirectory.Arrange(directory => directory.FullPath).Returns(Path.Combine(dir.AbsolutePath, "wurm"));
        }
        public void Setup()
        {
            //logsDir = TempDirectoriesFactory.CreateByCopy(Path.Combine(TestPaksDirFullPath, "MonthlyHeuristicsExtractor-sample-logs"));
            logsDir = TempDirectoriesFactory.CreateByUnzippingFile(Path.Combine(TestPaksZippedDirFullPath, "MonthlyHeuristicsExtractor-sample-logs.7z"));
            string basePath = logsDir.AbsolutePath;

            testFile = new FileInfo(Path.Combine(basePath, "Village.2013-03.txt"));
            emptyTestFile = new FileInfo(Path.Combine(basePath, "Village.2013-03.empty.txt"));
            invalidTestFile = new FileInfo(Path.Combine(basePath, "Village.2013-03.invaliddata.txt"));
            unrecognizedTestFile = new FileInfo(Path.Combine(basePath, "unrecognized.txt"));
            dailyLogFile = new FileInfo(Path.Combine(basePath, "Village.2012-10-24.txt"));
            fileWithBadStamp = new FileInfo(Path.Combine(basePath, "_Skills.2012-08.txt"));
            fileThatGoesBeyondMonthDays = new FileInfo(Path.Combine(basePath, "Village.2013-04.txt"));
            fileEvent201412 = new FileInfo(Path.Combine(basePath, "_Event.2014-12.txt"));
        }
 internal void FreeHandle(DirectoryHandle directoryHandle)
 {
     if (!directoryHandle.IsDisposed && directoryHandle.Dir.Exists)
     {
         directoryHandle.Dir.Delete(true);
     }
     directoryHandles.Remove(directoryHandle);
 }
 internal void RegisterHandle(DirectoryHandle directoryHandle)
 {
     directoryHandles.Add(directoryHandle);
 }
 public void Setup()
 {
     DataDir = TempDirectoriesFactory.CreateEmpty();
     var lib = new PersistentCollectionsLibrary(new FlatFilesPersistenceStrategy(DataDir.AbsolutePath));
     System = new SortedServerHistory(lib.DefaultCollection.GetObject<WurmApi.Modules.Wurm.ServerHistory.PersistentModel.ServerHistory>("default"));
 }
Beispiel #9
0
 public virtual void Setup()
 {
     dir = TempDirectoriesFactory.CreateEmpty();
 }