Skip to content

Commit

Permalink
improved commandexecuterwithparameter, Stupid interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christiaan baes committed Feb 22, 2013
1 parent 479ebd8 commit 21b7cec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Chocolatey Explorer/CommandPattern/CommandExecuter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class CommandExecuter : ICommandExecuter
command.Execute();
}

public void Execute<TCommandWithParameter, TParameterType>(TParameterType parameter) where TCommandWithParameter : class, ICommandWithParameter<object>, new()
public void Execute<TCommandWithParameter, TParameterType>(TParameterType parameter) where TCommandWithParameter : class, ICommandWithParameter<TParameterType>, new()
{
var command = new TCommandWithParameter();
command.ExecuteWitParameter(parameter);
Expand Down
2 changes: 1 addition & 1 deletion Chocolatey Explorer/CommandPattern/ICommandExecuter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ namespace Chocolatey.Explorer.CommandPattern
public interface ICommandExecuter
{
void Execute<TCommand>()where TCommand : class, ICommand, new();
void Execute<TCommandWithParameter, TParameterType>(TParameterType parameter) where TCommandWithParameter : class, ICommandWithParameter<Object>, new();
void Execute<TCommandWithParameter, TParameterType>(TParameterType parameter) where TCommandWithParameter : class, ICommandWithParameter<TParameterType>, new();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public void IfExecuteExecutesCommandWithParameter()
Assert.Throws<System.NotImplementedException>(() => executer.Execute<TestCommandWithParameter, String>("test"));
}

private class TestCommandWithParameter : ICommandWithParameter<object>
private class TestCommandWithParameter : ICommandWithParameter<String>
{
public void ExecuteWitParameter(object parameter)
public void ExecuteWitParameter(String parameter)
{
throw new System.NotImplementedException();
}
Expand Down

0 comments on commit 21b7cec

Please sign in to comment.