public Task Test(string testName, ITestConfigurationGenerator attribute)
        {
            var build           = new TestBuild();
            var relevantTargets = ExecutableTargetFactory.CreateAll(build, x => x.Compile);

            var stream = new MemoryStream();

            attribute.Stream = new StreamWriter(stream, leaveOpen: true);
            attribute.Generate(build, relevantTargets);

            stream.Seek(offset: 0, SeekOrigin.Begin);
            var reader = new StreamReader(stream);
            var str    = reader.ReadToEnd();

            return(Verifier.Verify(str)
                   .UseParameters(testName, attribute.GetType().BaseType.NotNull().Name));
        }
Beispiel #2
0
        public void Test(string testName, ITestConfigurationGenerator attribute)
        {
            var build           = new TestBuild();
            var relevantTargets = ExecutableTargetFactory.CreateAll(build, x => x.Compile);

            var stream = new MemoryStream();

            attribute.Stream = new StreamWriter(stream, leaveOpen: true);
            attribute.Generate(build, relevantTargets);

            stream.Seek(offset: 0, SeekOrigin.Begin);
            var reader = new StreamReader(stream);
            var str    = reader.ReadToEnd();

            NamerFactory.AdditionalInformation = attribute.GetType().BaseType.NotNull().Name;
            if (testName != null)
            {
                NamerFactory.AdditionalInformation += "." + testName;
            }
            Approvals.Verify(str);
        }