Esempio n. 1
0
        public void ExecTestCase_AppliesCorrectNumberOfBindingsMultipleFacettes()
        {
            var n = typeof(TestyHarness);

            TestyHarness.valueSets.Clear();
            IOCSetup();

            Api.CreateFacette("TestFac", new List <object>()
            {
                1, 2, 3
            });
            Api.CreateFacette("TestFac2", new List <object>()
            {
                4, 5, 6
            });
            Api.BeginTestCase(n.AssemblyQualifiedName, null);
            Api.AddFacette("TestFac", 1, 2);
            Api.AddFacette("TestFac2", 1, 1);

            var coll = new AssertCollection();

            coll.Push(() => true);
            Api.CommitTestCaseCode(coll);
            Api.ExecTestCase();

            var res = Api.GetResults();

            Assert.AreEqual(18, res.Count);
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new <see cref="ImportAssetsTag"/> instance.
 /// </summary>
 /// <param name="url">URL.</param>
 /// <param name="exportedCharacters">Exported characters.</param>
 public ImportAssetsTag(string url, Assert[] exportedCharacters)
 {
     this.url = url;
     this.exportedCharacters = new AssertCollection();
     this.exportedCharacters.AddRange(exportedCharacters);
     this._tagCode = (int)TagCodeEnum.ExportAssets;
 }
Esempio n. 3
0
        public void TestGenericInheritance()
        {
            IServiceCollection serviceCollection = new ServiceCollection();

            serviceCollection.AddTransientPlugins <TestInterfaces.ITestInterface>("TestAssemblies/GenericTestAssembly/**/*.dll");
            System.Collections.Generic.IEnumerable <TestInterfaces.ITestInterface> services = serviceCollection.BuildServiceProvider().GetServices <TestInterfaces.ITestInterface>();

            AssertCollection.CollectionHasAny(services, output,
                                              t => Assert.Equal(typeof(GenericClass), t.GetType()),
                                              t => Assert.Equal(typeof(ControlClass), t.GetType())
                                              );
        }
Esempio n. 4
0
        public void TestLoadingFromSeperateFolders()
        {
            IServiceCollection serviceCollection = new ServiceCollection();

            serviceCollection.AddTransientPlugins <TestInterfaces.ITestInterface>("TestAssemblies/TestAssembly1/**/*.dll", "TestAssemblies/TestAssembly2/**/*.dll");
            System.Collections.Generic.IEnumerable <TestInterfaces.ITestInterface> services = serviceCollection.BuildServiceProvider().GetServices <TestInterfaces.ITestInterface>();

            AssertCollection.CollectionHasAny(services, output,
                                              t => Assert.Equal(typeof(MultiAssemblyPlugin), t.GetType()),
                                              t => Assert.Equal(typeof(TestPlugin), t.GetType()),
                                              t => Assert.Equal(typeof(AnotherTestPlugin), t.GetType()),
                                              t => Assert.Equal(typeof(TestPlugin2), t.GetType()));
        }
Esempio n. 5
0
        public void ExecTestCase_Throws_NoTestCaseStartedException_IfNoTestCaseWasBegun()
        {
            var n = typeof(TestyHarness);

            IOCSetup();

            try
            {
                var coll = new AssertCollection();
                coll.Push(() => true);
                Api.CommitTestCaseCode(coll);
                Api.ExecTestCase();
                Assert.Fail("Did not throw execption!");
            }
            catch (NoTestCaseStartedException)
            {
                // All good!
                return;
            }
        }
Esempio n. 6
0
        public void ExecTestCase_AppliesBindings()
        {
            var n = typeof(TestyHarness);

            IOCSetup();

            Api.CreateFacette("TestFac", new List <object>()
            {
                1, 2, 3
            });
            Api.BeginTestCase(n.AssemblyQualifiedName, null);
            Api.AddFacette("TestFac", 1, 1);

            var coll = new AssertCollection();

            coll.Push(() => true);
            Api.CommitTestCaseCode(coll);
            Api.ExecTestCase();

            Assert.AreEqual(3, TestyHarness.valueSets.Count);
        }
Esempio n. 7
0
 /// <summary>
 /// Creates a new <see cref="ExportAssetsTag"/> instance.
 /// </summary>
 /// <param name="exportedCharacters">Exported characters.</param>
 public SymbolClassTag(Assert[] exportedCharacters)
 {
     this.exportedCharacters = new AssertCollection();
     this.exportedCharacters.AddRange(exportedCharacters);
     this._tagCode = (int)TagCodeEnum.SymbolClass;
 }
Esempio n. 8
0
 /// <summary>
 /// Creates a new <see cref="ExportAssetsTag"/> instance.
 /// </summary>
 public SymbolClassTag()
 {
     this._tagCode      = (int)TagCodeEnum.SymbolClass;
     exportedCharacters = new AssertCollection();
 }
Esempio n. 9
0
 /// <summary>
 /// Creates a new <see cref="ExportAssetsTag"/> instance.
 /// </summary>
 /// <param name="exportedCharacters">Exported characters.</param>
 public ExportAssetsTag(Assert[] exportedCharacters)
 {
     this.exportedCharacters = new AssertCollection();
     this.exportedCharacters.AddRange(exportedCharacters);
     this._tagCode = (int)TagCodeEnum.ExportAssets;
 }
Esempio n. 10
0
 /// <summary>
 /// Creates a new <see cref="ExportAssetsTag"/> instance.
 /// </summary>
 public ExportAssetsTag()
 {
     this._tagCode      = (int)TagCodeEnum.ExportAssets;
     exportedCharacters = new AssertCollection();
 }
Esempio n. 11
0
 public void Setup()
 {
     theCollection = new AssertCollection();
 }