예제 #1
0
        public void ReplyRequest_ForStoppedOutside()
        {
            driver.Start();
            driverSC.SetStatus(ServiceControllerStatus.Stopped);

            AdvAssert.ThrowsInvalidOperation(() => driver.ReplyRequest(new ACCESS_REQUEST(), false));
        }
예제 #2
0
        public void GetRequest_ForStoppedOutside()
        {
            driver.Start();
            driverSC.SetStatus(ServiceControllerStatus.Stopped);

            AdvAssert.ThrowsInvalidOperation(() => driver.GetRequest());
        }
예제 #3
0
        public void SendCommand_ToStartedOutside()
        {
            // Start outside
            driverSC.SetStatus(ServiceControllerStatus.Running);

            AdvAssert.ThrowsInvalidOperation(() => driver.SendCommand(COMMAND_TYPE.ADD, @"C:\SomeFolder\somefile.txt", 0));
        }
예제 #4
0
        public void DetailsVisibile_WhenLogViewIsNull()
        {
            var presenter = new LogViewPresenter(new LogViewModel(eventLog));

            AdvAssert.ThrowsInvalidOperation(() => presenter.DetailsVisible.ToString());
            AdvAssert.ThrowsInvalidOperation(() => presenter.DetailsVisible = false);
        }
예제 #5
0
        public void Stop_CloseHandleFails()
        {
            driver.Start();

            fltLib.CloseHandleReturn = false;

            AdvAssert.ThrowsInvalidOperation(() => driver.Stop());
        }
예제 #6
0
        public void Paths_ExpandedPath_NotSupportedRegistryPaths()
        {
            var rs      = new Ruleset();
            var PathRow = rs.Paths.AddPathsRow("123");

            var TestValues = new[]
            {
                @"HKEY_CURRENT_CONFIG\Software",
                @"HKCC\Software",
                @"HKEY_CLASSES_ROOT\._sln",
                @"HKCR\._sln",
                @"HKEY_DYN_DATA\123",
                @"HKDD\123",
                @"HKEY_PERFORMANCE_DATA\123",
                @"HKPD\123"
            };

            foreach (var testValue in TestValues)
            {
                PathRow.Path = testValue;
                AdvAssert.ThrowsInvalidOperation(delegate { var p = PathRow.ExpandedPaths; });
            }
        }
예제 #7
0
        public void Start_AlreadyStarted()
        {
            driver.Start();

            AdvAssert.ThrowsInvalidOperation(driver.Start);
        }
예제 #8
0
 public void ReplyRequest_ToStopped()
 {
     AdvAssert.ThrowsInvalidOperation(() => driver.ReplyRequest(new ACCESS_REQUEST(), false));
 }
예제 #9
0
 public void GetRequest_FromStopped()
 {
     AdvAssert.ThrowsInvalidOperation(() => driver.GetRequest());
 }
예제 #10
0
 public void SendCommand_ToStopped()
 {
     AdvAssert.ThrowsInvalidOperation(() => driver.SendCommand(COMMAND_TYPE.ADD, @"C:\SomeFolder\somefile.txt", 0));
 }
예제 #11
0
 public void LastAllowedMessageID_Default()
 {
     AdvAssert.ThrowsInvalidOperation(() => stub.LastAllowedMessageID.ToString());
 }
예제 #12
0
        public void FilterReplyMessage_ZeroMessageID()
        {
            var permission = new PERMISSION();

            AdvAssert.ThrowsInvalidOperation(() => stub.FilterReplyMessage(IntPtr.Zero, ref permission, 0));
        }
예제 #13
0
 public void Start_AlreadyStartedCore()
 {
     core.Start(ruleset, serviceInterface, null);
     AdvAssert.ThrowsInvalidOperation(() => core.Start(ruleset, serviceInterface, null));
 }
예제 #14
0
 public void WaitRequest_Stopped()
 {
     AdvAssert.ThrowsInvalidOperation(() => core.WaitRequest());
 }
예제 #15
0
 public void RefreshRules_WhenMainDisplayed()
 {
     _Form.ShowMain();
     AdvAssert.ThrowsInvalidOperation(() => _Form.RefreshRules());
 }