Example #1
0
        public void GetRequest_FilterGetMessageFails()
        {
            driver.Start();
            fltLib.SetGetMessageReturn(-125, new ACCESS_REQUEST());

            AdvAssert.Throws <COMException>(() => driver.GetRequest(), "ErrorCode", -125);
        }
Example #2
0
        public void ReplyRequest_FilterReplyMessageFails()
        {
            driver.Start();
            fltLib.FilterReplyMessageReturnCode = -125;

            AdvAssert.Throws <COMException>(() => driver.ReplyRequest(new ACCESS_REQUEST {
                MessageId = 1
            }, true), "ErrorCode", -125);
        }
Example #3
0
        public void SendCommand_AddingSamePaths()
        {
            driver.Start();

            driver.SendCommand(COMMAND_TYPE.ADD, "C:\\test.txt", 1);

            AdvAssert.Throws <PathAlreadyAddedException>(() => driver.SendCommand(COMMAND_TYPE.ADD, "C:\\test.txt", 1),
                                                         "Path", "C:\\test.txt");
        }
Example #4
0
        public void Start_ConnectFails()
        {
            // Start will throw COMException in case if FilterConnectCommunication fail.

            // FilterConnectCommunicationPort will return this error code.
            fltLib.FilterConnectCommunicationPortReturnCode = -123;

            // Act - Assert
            AdvAssert.Throws <COMException>(() => driver.Start(), "ErrorCode", -123);
        }
Example #5
0
        public void Start_IntermediateStatusesArentSupported()
        {
            // Assert
            var UnsupportedStatuses = new[]
            {
                ServiceControllerStatus.ContinuePending,
                ServiceControllerStatus.Paused,
                ServiceControllerStatus.PausePending,
                ServiceControllerStatus.StartPending,
                ServiceControllerStatus.StopPending
            };

            // Act - Assert
            foreach (var unsupportedStatus in UnsupportedStatuses)
            {
                driverSC.SetStatus(unsupportedStatus);
                AdvAssert.Throws <NotSupportedException>(() => driver.Start());
            }
        }
Example #6
0
 public void SendCommand_FilterSendMessageFails()
 {
     fltLib.FilterSendMessageReturnCode = -123;
     driver.Start();
     AdvAssert.Throws <COMException>(() => driver.SendCommand(COMMAND_TYPE.ADD, @"C:\somefile.txt", 22), "ErrorCode", -123);
 }
Example #7
0
        public void SendCommand_DelNotAddedID()
        {
            driver.Start();

            AdvAssert.Throws <IdNotFoundException>(() => driver.SendCommand(COMMAND_TYPE.DEL, null, 33), "ID", 33);
        }