예제 #1
0
        public void CreateClassInProjectFolder()
        {
            var sceneSpy     = new Scene();
            var spyGenerator = new SceneCodeGeneratorSpy(new MockService("", "TestProject"), sceneSpy,
                                                         "TestScene");

            spyGenerator.GenerateSourceCodeClass();
            Assert.IsTrue(spyGenerator.CreatedSourceClass);
            Assert.IsTrue(
                spyGenerator.csprojString.Contains("<Compile Include=" + '"' + "TestScene" + ".cs" + '"' +
                                                   " />"));
        }
예제 #2
0
        public void OverwriteCreatedClass()
        {
            var sceneSpy     = new Scene();
            var spyGenerator = new SceneCodeGeneratorSpy(new MockService("", "TestProject"), sceneSpy,
                                                         "TestScene");

            spyGenerator.GenerateSourceCodeClass();
            var firstClassString = spyGenerator.CreatedSourceClass;

            Assert.IsTrue(spyGenerator.CreatedSourceClass);
            sceneSpy.Add(new Button(new Rectangle()));
            spyGenerator.GenerateSourceCodeClass();
            Assert.AreNotEqual(firstClassString, spyGenerator.CreatedClassString);
        }
		public void OverwriteCreatedClass()
		{
			var sceneSpy = new Scene();
			var spyGenerator = new SceneCodeGeneratorSpy(new MockService("", "TestProject"), sceneSpy,
				"TestScene");
			spyGenerator.GenerateSourceCodeClass();
			var firstClassString = spyGenerator.CreatedSourceClass;
			Assert.IsTrue(spyGenerator.CreatedSourceClass);
			sceneSpy.Add(new Button(new Rectangle()));
			spyGenerator.GenerateSourceCodeClass();
			Assert.AreNotEqual(firstClassString, spyGenerator.CreatedClassString);
		}
		public void CreateClassInProjectFolder()
		{
			var sceneSpy = new Scene();
			var spyGenerator = new SceneCodeGeneratorSpy(new MockService("", "TestProject"), sceneSpy,
				"TestScene");
			spyGenerator.GenerateSourceCodeClass();
			Assert.IsTrue(spyGenerator.CreatedSourceClass);
			Assert.IsTrue(
				spyGenerator.csprojString.Contains("<Compile Include=" + '"' + "TestScene" + ".cs" + '"' +
					" />"));
		}