Bamboo.Prevalence.Util.Tests.SnapshotTakerTest.TestCleanUpAllFilesPolicy C# (CSharp) Method

TestCleanUpAllFilesPolicy() private method

private TestCleanUpAllFilesPolicy ( ) : void
return void
		public void TestCleanUpAllFilesPolicy()
		{
			// some log files...
			Add(20); // 1st log file
			CrashRecover();
			Add(30); // 2nd log file			
			_engine.TakeSnapshot(); // 1st snapshot
			Add(10); // 3rd log file
			_engine.TakeSnapshot(); // 2nd snapshot
			Add(20); // 4rd log file
			
			FileInfo[] files = CleanUpAllFilesPolicy.Default.SelectFiles(_engine);			

			AssertEquals(4, files.Length);
			AssertEquals(FormatCommandLogName(1), files[0].Name);
			AssertEquals(FormatCommandLogName(2), files[1].Name);
			AssertEquals(FormatSnapshotName(2), files[2].Name);
			AssertEquals(FormatCommandLogName(3), files[3].Name);

			SnapshotTaker taker = new SnapshotTaker(_engine, TimeSpan.FromMilliseconds(200), CleanUpAllFilesPolicy.Default);
			Thread.Sleep(300);
			taker.Dispose();

			// sanity check
			CrashRecover();
			AssertTotal(80);
		}