添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to override parameters and pass them to xUnit runner on VSTS Build like described here for MS Test?
https://blogs.msdn.microsoft.com/devops/2015/09/04/supplying-run-time-parameters-to-tests/

@onovotny , could you show me a screenshot with build task and settings of how to do this?
All the thing I tried do not work.

In my test I do this:

Constructor

IConfigurationRoot configuration = new ConfigurationBuilder()
    .AddUserSecrets<Startup>()
    .AddEnvironmentVariables()
    .Build();
var service = new ServiceCollection();
service.AddOptions();
service.Configure<MongoDbSettings>(configuration.GetSection("MongoDbAzure"))

Where

public class MongoDbSettings
    public string ConnectionString { get; set; } = "mongodb://localhost:27017";

And build variable in VSTS is set as MongoDbAzure:ConnectionString
But its value is not picked up.

@onovotny, @bradwilson, @davidfowl is there something wrong I do?

Hey guys,

I'm facing same similar issue. Basically trying to read from xunit console a param to decide on which environment to run my test. I know Nunit support that via TestContext.Parameters[paramName] - but not sure how this can be done in xUnit. Any thoughts?

Thanks a mil.

Hi guys, I'm using xUnit Testing in my project, In that my input was diiferent from normal xUnit input.
I want to test
var bbCarResponse = await _bbDataService.GetMktListingAsync(request);
this method.
Basically my inputs from a class file.
public class Request : ServiceRequest
public string Name { get; set; }
public string Model { get; set; }
public string Zipcode { get; set; }
So the request is "Request request".
How shall i test in xUnit please let me know.
Thanks.