public void Ctor_WhenCalled_SetsProperties() { // arrange, act var otherCommandType = typeof(SampleCommand); var commandType = typeof(DuplicateSampleCommand); var sut = new CommandNameAlreadyUsedException("sample", commandType, otherCommandType); // assert Assert.Equal("sample", sut.CommandName); Assert.Equal(otherCommandType, sut.OtherCommandType); Assert.Equal(commandType, sut.CommandType); }
public void ToString_WhenCalled_ReturnsMessage() { // arrange var otherCommandType = typeof(SampleCommand); var commandType = typeof(DuplicateSampleCommand); var sut = new CommandNameAlreadyUsedException("sample", commandType, otherCommandType); // act var result = sut.ToString(); // assert Assert.Equal("Chel.CommandNameAlreadyUsedException: Command name 'sample' on command type Chel.UnitTests.SampleCommands.DuplicateSampleCommand is already used on command type Chel.UnitTests.SampleCommands.SampleCommand", result); }