public void ThrowArgumentNullException_WhenNullPersonsCollectionIsPassed() { //Arrange IPersonsCollection personList = null; var wIMTeams = new Mock <IWIMTeams>(); //Act&Assert var ex = Assert.ThrowsException <ArgumentNullException>(() => new Getters(personList, wIMTeams.Object)); Assert.AreEqual(string.Format(CommandsConsts.NULL_OBJECT, nameof(personList)), ex.ParamName); }
public Getters(IPersonsCollection personList, IWIMTeams wimTeams) { this.personList = personList ?? throw new ArgumentNullException( string.Format( CommandsConsts.NULL_OBJECT, nameof(personList))); this.wimTeams = wimTeams ?? throw new ArgumentNullException( string.Format( CommandsConsts.NULL_OBJECT, nameof(wimTeams))); }
public void Throw_When_A_Passed_Value_Is_Null() { //Arrange IPersonsCollection personList = null; var expectedMessage = string.Format(CommandsConsts.NULL_OBJECT, nameof(personList)); //Act,Assert var testMessage = Assert.ThrowsException <ArgumentNullException>(() => new ShowAllPeopleCommand(personList)); //Assert Assert.AreEqual(expectedMessage, testMessage.ParamName); }
public CreatePersonCommand(IHistoryEventWriter historyEventWriter, IPersonsCollection personList, IComponentsFactory componentsFactory) { this.historyEventWriter = historyEventWriter ?? throw new ArgumentNullException( string.Format( CommandsConsts.NULL_OBJECT, nameof(historyEventWriter))); this.personList = personList ?? throw new ArgumentNullException( string.Format( CommandsConsts.NULL_OBJECT, nameof(personList))); this.componentsFactory = componentsFactory ?? throw new ArgumentNullException( string.Format( CommandsConsts.NULL_OBJECT, nameof(componentsFactory))); }
public FakeShowAllPeopleCommand(IPersonsCollection personList) : base(personList) { }
public FakeGetters(IPersonsCollection personList, IWIMTeams wimTeams) : base(personList, wimTeams) { }
public ShowAllPeopleCommand(IPersonsCollection personList) { this.personList = personList ?? throw new ArgumentNullException( string.Format(CommandsConsts.NULL_OBJECT, nameof(personList))); }