Inheritance: System.Attribute
Exemplo n.º 1
0
    public void FactAttributeGeneratesFactCommand()
    {
        MethodInfo method = typeof(FactAttributeTests).GetMethod("DummyFactMethod");
        FactAttribute attribute = new FactAttribute();

        List<ITestCommand> results = new List<ITestCommand>(attribute.CreateTestCommands(Reflector.Wrap(method)));

        ITestCommand result = Assert.Single(results);
        Assert.IsType<FactCommand>(result);
    }
Exemplo n.º 2
0
    public void DefaultFactAttributeValues()
    {
        FactAttribute attrib = new FactAttribute();
        MethodInfo method = typeof(FactAttributeTests).GetMethod("DummyFactMethod");

        var commands = new List<ITestCommand>(attrib.CreateTestCommands(Reflector.Wrap(method)));

        ITestCommand command = Assert.Single(commands);
        FactCommand factCommand = Assert.IsType<FactCommand>(command);
        Assert.Equal("FactAttributeTests", factCommand.TypeName);
        Assert.Equal("DummyFactMethod", factCommand.MethodName);
        Assert.Equal("FactAttributeTests.DummyFactMethod", factCommand.DisplayName);
    }