public void FormatShouldReturnExpectedDisplayNameFromMethodWithReplacedSpacesAndOperators(string name, string expected) { var formatter = new DisplayNameFormatter(display: Method, displayOptions: ReplaceUnderscoreWithSpace | UseOperatorMonikers); var actual = formatter.Format(name); Assert.Equal(expected, actual); }
public void FormatShouldReturnExpectedDisplayNameFromMethodWithSpacesInsteadOfUnderscores(string name, string expected) { var formatter = new DisplayNameFormatter(display: Method, displayOptions: ReplaceUnderscoreWithSpace); var actual = formatter.Format(name); Assert.Equal(expected, actual); }
public void FormatShouldReturnExpectedDisplayNameFromMethodWithAllOptions(string name, string expected) { var formatter = new DisplayNameFormatter(display: Method, displayOptions: All); var actual = formatter.Format(name); Assert.Equal(expected, actual); }
/// <inheritdoc/> public virtual void Deserialize(IXunitSerializationInfo data) { TestMethod = data.GetValue <ITestMethod>("TestMethod"); TestMethodArguments = data.GetValue <object[]>("TestMethodArguments"); DefaultMethodDisplay = (TestMethodDisplay)Enum.Parse(typeof(TestMethodDisplay), data.GetValue <string>("DefaultMethodDisplay")); DefaultMethodDisplayOptions = (TestMethodDisplayOptions)Enum.Parse(typeof(TestMethodDisplayOptions), data.GetValue <string>("DefaultMethodDisplayOptions")); formatter = new DisplayNameFormatter(DefaultMethodDisplay, DefaultMethodDisplayOptions); }
/// <summary> /// Initializes a new instance of the <see cref="TestMethodTestCase"/> class. /// </summary> /// <param name="defaultMethodDisplay">Default method display to use (when not customized).</param> /// <param name="defaultMethodDisplayOptions">Default method display options to use (when not customized).</param> /// <param name="testMethod">The test method this test case belongs to.</param> /// <param name="testMethodArguments">The arguments for the test method.</param> protected TestMethodTestCase(TestMethodDisplay defaultMethodDisplay, TestMethodDisplayOptions defaultMethodDisplayOptions, ITestMethod testMethod, object[] testMethodArguments = null) { DefaultMethodDisplay = defaultMethodDisplay; DefaultMethodDisplayOptions = defaultMethodDisplayOptions; formatter = new DisplayNameFormatter(defaultMethodDisplay, defaultMethodDisplayOptions); TestMethod = testMethod; TestMethodArguments = testMethodArguments; }
/// <summary> /// Initializes a new instance of the <see cref="TestMethodTestCase"/> class. /// </summary> /// <param name="defaultMethodDisplay">Default method display to use (when not customized).</param> /// <param name="defaultMethodDisplayOptions">Default method display options to use (when not customized).</param> /// <param name="testMethod">The test method this test case belongs to.</param> /// <param name="testMethodArguments">The arguments for the test method.</param> protected TestMethodTestCase( TestMethodDisplay defaultMethodDisplay, TestMethodDisplayOptions defaultMethodDisplayOptions, ITestMethod testMethod, object[] testMethodArguments = null) { DefaultMethodDisplay = defaultMethodDisplay; DefaultMethodDisplayOptions = defaultMethodDisplayOptions; formatter = new DisplayNameFormatter(defaultMethodDisplay, defaultMethodDisplayOptions); TestMethod = testMethod; TestMethodArguments = testMethodArguments; }
/// <summary> /// Used for de-serialization. /// </summary> protected TestMethodTestCase() { formatter = new DisplayNameFormatter(); }
/// <inheritdoc/> public virtual void Deserialize(IXunitSerializationInfo data) { TestMethod = data.GetValue<ITestMethod>("TestMethod"); TestMethodArguments = data.GetValue<object[]>("TestMethodArguments"); DefaultMethodDisplay = (TestMethodDisplay)Enum.Parse(typeof(TestMethodDisplay), data.GetValue<string>("DefaultMethodDisplay")); DefaultMethodDisplayOptions = (TestMethodDisplayOptions)Enum.Parse(typeof(TestMethodDisplayOptions), data.GetValue<string>("DefaultMethodDisplayOptions")); formatter = new DisplayNameFormatter(DefaultMethodDisplay, DefaultMethodDisplayOptions); }
public void FormatShouldReturnExpectedDisplayNameFromClassAndMethodWithReplacedSpacesAndEscapeSequences(string name, string expected) { var formatter = new DisplayNameFormatter(display: ClassAndMethod, displayOptions: ReplaceUnderscoreWithSpace | UseEscapeSequences); var actual = formatter.Format(name); Assert.Equal(expected, actual); }