예제 #1
0
        public void Throw_ArgumentNullException_When_TeamDontExist()
        {
            //Arrange
            var personListMock = new Mock <IPersonsCollection>();
            var wIMTeamMock    = new Mock <IWIMTeams>();

            wIMTeamMock.Setup(w => w.TeamsList).Returns(new Mock <IDictionary <string, ITeam> >().Object);
            var teamMock = new Mock <ITeam>();

            teamMock.Setup(x => x.TeamName).Returns("TeamName");
            var sut = new Getters(personListMock.Object, wIMTeamMock.Object);
            //Act&&Assert
            var ex = Assert.ThrowsException <ArgumentException>(() => sut.GetMember(teamMock.Object, "Pesho"));

            Assert.AreEqual(string.Format(CommandsConsts.NoTeamFound, teamMock.Object.TeamName), ex.Message);
        }