Exemplo n.º 1
0
        public void Start_WithNotNullProcess_ShoulThrowException()
        {
            ISikuliRuntime runtime = new SikuliRuntime(_manager);
            var            process = runtime
                                     .GetType()
                                     .GetFields(BindingFlags.NonPublic | BindingFlags.Instance)
                                     .FirstOrDefault(f => f.FieldType == typeof(Process));

            var processMock = new Mock <Process>();

            process.SetValue(runtime, processMock.Object);

            runtime.Invoking(m => m.Start()).Should().Throw <InvalidOperationException>();
        }
Exemplo n.º 2
0
        public void Stop_WithNullProcess_ShouldReturn()
        {
            var runtime = new SikuliRuntime(_manager);

            runtime.Invoking(m => m.Stop()).Should().NotThrow();
        }