Ejemplo n.º 1
0
		public void Create()
		{
			var engineMock = Rock.Create<IBuildEngine>();
			engineMock.Handle(_ => _.LogMessageEvent(Arg.IsAny<BuildMessageEventArgs>()), 2);

			var task = new RocksTask { AssemblyLocation = typeof(Class1).Assembly.Location };
			task.BuildEngine = engineMock.Make();
			task.Execute();

			Assert.IsNotNull(task.Result);

			engineMock.Verify();
		}
Ejemplo n.º 2
0
        public static void Create()
        {
            var engineMock = Rock.Create <IBuildEngine>(
                new RockOptions(codeFileDirectory: TestContext.CurrentContext.TestDirectory));

            engineMock.Handle(_ => _.LogMessageEvent(Arg.IsAny <BuildMessageEventArgs>()), 2);

            var task = new RocksTask
            {
                AssemblyLocation  = typeof(TaskTarget).Assembly.Location,
                CodeFileDirectory = TestContext.CurrentContext.TestDirectory
            };

            task.BuildEngine = engineMock.Make();
            task.Execute();

            Assert.That(task.Result, Is.Not.Null);

            engineMock.Verify();
        }