コード例 #1
0
 public void Build_Should_Work()
 {
     LockBuilder.Build();
     LockBuilder.LaunchLock.Username.Should().NotBeEmpty();
     LockBuilder.LaunchLock.LockTime.Should().BeOnOrBefore(DateTime.Now);
     LockBuilder.LaunchLock.FileName.Should().NotBeNullOrEmpty();
 }
コード例 #2
0
        public void RemoveLock_Should_Remove_Current_Lock()
        {
            // create valid lock that shouldn't get removed
            var validLock = $"{TestFileName}.{Guid.NewGuid()}.launchlock";

            FileSystem.AddFile(validLock, new Mocks().GetLaunchLockJson(validLock));

            // create current lock that should get removed
            LockBuilder.Build();
            LockWriter.Write();

            GetCurrentLauchLocks();

            Unlocker.RemoveLock();

            GetCurrentLauchLocks().Count().Should().Be(1);
        }
コード例 #3
0
 public override void Intialize()
 {
     Configuration.CheckIfValid(new string[] { TestFileName }, out string message);
     LockBuilder.Build();
 }