Exemple #1
0
        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)));
 }
Exemple #3
0
        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)));
 }
Exemple #5
0
 public FakeShowAllPeopleCommand(IPersonsCollection personList)
     : base(personList)
 {
 }
Exemple #6
0
 public FakeGetters(IPersonsCollection personList, IWIMTeams wimTeams) : base(personList, wimTeams)
 {
 }
Exemple #7
0
 public ShowAllPeopleCommand(IPersonsCollection personList)
 {
     this.personList = personList ?? throw new ArgumentNullException(
                                 string.Format(CommandsConsts.NULL_OBJECT,
                                               nameof(personList)));
 }