Beispiel #1
0
        /// <summary>
        /// Initializes a new instance  of the <see cref="Xunit1TestCase"/> class.
        /// </summary>
        /// <param name="assemblyFileName">The assembly under test.</param>
        /// <param name="typeName">The type under test.</param>
        /// <param name="methodName">The method under test.</param>
        /// <param name="displayName">The display name of the unit test.</param>
        /// <param name="traits">The traits of the unit test.</param>
        /// <param name="skipReason">The skip reason, if the test is skipped.</param>
        public Xunit1TestCase(string assemblyFileName,
                              string typeName,
                              string methodName,
                              string displayName,
                              Dictionary <string, List <string> > traits = null,
                              string skipReason = null)
        {
            reflectionWrapper = new Xunit1ReflectionWrapper(assemblyFileName, typeName, methodName);

            DisplayName = displayName;
            Traits      = traits ?? EmptyTraits;
            SkipReason  = skipReason;
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance  of the <see cref="Xunit1TestCase"/> class.
        /// </summary>
        /// <param name="assemblyFileName">The assembly under test.</param>
        /// <param name="typeName">The type under test.</param>
        /// <param name="methodName">The method under test.</param>
        /// <param name="displayName">The display name of the unit test.</param>
        /// <param name="traits">The traits of the unit test.</param>
        /// <param name="skipReason">The skip reason, if the test is skipped.</param>
        public Xunit1TestCase(string assemblyFileName,
                              string typeName,
                              string methodName,
                              string displayName,
                              Dictionary<string, List<string>> traits = null,
                              string skipReason = null)
        {
            reflectionWrapper = new Xunit1ReflectionWrapper(assemblyFileName, typeName, methodName);

            DisplayName = displayName;
            Traits = traits ?? EmptyTraits;
            SkipReason = skipReason;
        }
Beispiel #3
0
        /// <inheritdoc/>
        protected Xunit1TestCase(SerializationInfo info, StreamingContext context)
        {
            reflectionWrapper = new Xunit1ReflectionWrapper(
                info.GetString("AssemblyFileName"),
                info.GetString("TypeName"),
                info.GetString("MethodName")
            );

            DisplayName = info.GetString("DisplayName");
            SkipReason = info.GetString("SkipReason");
            SourceInformation = info.GetValue<SourceInformation>("SourceInformation");
            Traits = info.GetValue<IDictionary<string, string>>("Traits");
        }
Beispiel #4
0
        /// <inheritdoc/>
        protected Xunit1TestCase(SerializationInfo info, StreamingContext context)
        {
            reflectionWrapper = new Xunit1ReflectionWrapper(
                info.GetString("AssemblyFileName"),
                info.GetString("TypeName"),
                info.GetString("MethodName")
            );

            DisplayName = info.GetString("DisplayName");
            SkipReason = info.GetString("SkipReason");
            SourceInformation = info.GetValue<SourceInformation>("SourceInformation");

            Traits = new Dictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase);
            var keys = info.GetValue<List<string>>("Traits.Keys");
            foreach (var key in keys)
                Traits.Add(key, info.GetValue<List<string>>(String.Format("Traits[{0}]", key)));
        }
Beispiel #5
0
        /// <inheritdoc/>
        protected Xunit1TestCase(SerializationInfo info, StreamingContext context)
        {
            reflectionWrapper = new Xunit1ReflectionWrapper(
                info.GetString("AssemblyFileName"),
                info.GetString("TypeName"),
                info.GetString("MethodName")
                );

            DisplayName       = info.GetString("DisplayName");
            SkipReason        = info.GetString("SkipReason");
            SourceInformation = info.GetValue <SourceInformation>("SourceInformation");

            Traits = new Dictionary <string, List <string> >(StringComparer.OrdinalIgnoreCase);
            var keys = info.GetValue <List <string> >("Traits.Keys");

            foreach (var key in keys)
            {
                Traits.Add(key, info.GetValue <List <string> >(String.Format("Traits[{0}]", key)));
            }
        }
Beispiel #6
0
        /// <inheritdoc/>
        public void Deserialize(IXunitSerializationInfo data)
        {
            reflectionWrapper = new Xunit1ReflectionWrapper(
                data.GetValue <string>("AssemblyFileName"),
                data.GetValue <string>("TypeName"),
                data.GetValue <string>("MethodName")
                );

            ConfigFileName    = data.GetValue <string>("ConfigFileName");
            DisplayName       = data.GetValue <string>("DisplayName");
            SkipReason        = data.GetValue <string>("SkipReason");
            SourceInformation = data.GetValue <SourceInformation>("SourceInformation");

            Traits = new Dictionary <string, List <string> >(StringComparer.OrdinalIgnoreCase);
            var keys = data.GetValue <string[]>("Traits.Keys");

            foreach (var key in keys)
            {
                Traits.Add(key, data.GetValue <string[]>(string.Format("Traits[{0}]", key)).ToList());
            }
        }
Beispiel #7
-1
        /// <inheritdoc/>
        public void Deserialize(IXunitSerializationInfo data)
        {
            reflectionWrapper = new Xunit1ReflectionWrapper(
                data.GetValue<string>("AssemblyFileName"),
                data.GetValue<string>("TypeName"),
                data.GetValue<string>("MethodName")
            );

            ConfigFileName = data.GetValue<string>("ConfigFileName");
            DisplayName = data.GetValue<string>("DisplayName");
            SkipReason = data.GetValue<string>("SkipReason");
            SourceInformation = data.GetValue<SourceInformation>("SourceInformation");

            Traits = new Dictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase);
            var keys = data.GetValue<string[]>("Traits.Keys");
            foreach (var key in keys)
                Traits.Add(key, data.GetValue<string[]>(String.Format("Traits[{0}]", key)).ToList());
        }