public void InvalidColumnsException_AllParamsIsValid_OneProfileColumn_ReturnBadRequestException()
        {
            var expectedMessage = I18NHelper.FormatInvariant(
                ErrorMessages.ArtifactList.ColumnsSettings.SingleInvalidColumn,
                _profileColumns.First().PropertyName);

            var result = ArtifactListExceptionHelper.InvalidColumnsException(_profileColumns);

            Assert.IsNotNull(result);
            Assert.AreEqual(expectedMessage, result.Message);
        }
        public void InvalidColumnsException_AllParamsIsValid_TwoOrThreeProfileColumns_ReturnBadRequestException()
        {
            _profileColumns = new List <ProfileColumn>
            {
                new ProfileColumn("Custom1", PropertyTypePredefined.CustomGroup, PropertyPrimitiveType.Number, 2),
                new ProfileColumn("Custom2", PropertyTypePredefined.CustomGroup, PropertyPrimitiveType.Number, 2),
                new ProfileColumn("Custom3", PropertyTypePredefined.CustomGroup, PropertyPrimitiveType.Number, 2)
            };

            var expectedMessage = I18NHelper.FormatInvariant(
                ErrorMessages.ArtifactList.ColumnsSettings.SomeInvalidColumns,
                string.Join(", ", _profileColumns.Take(_maxPropertiesToShow).Select(column => column.PropertyName)));

            var result = ArtifactListExceptionHelper.InvalidColumnsException(_profileColumns);

            Assert.IsNotNull(result);
            Assert.AreEqual(expectedMessage, result.Message);
        }
 public void InvalidColumnsException_ProfileColumnsIsNull_ThrowArgumentException()
 {
     _profileColumns = null;
     ArtifactListExceptionHelper.InvalidColumnsException(_profileColumns);
 }
 public void InvalidColumnsException_ProfileColumnsIsEmpty_ThrowArgumentException()
 {
     _profileColumns = new List <ProfileColumn>();
     ArtifactListExceptionHelper.InvalidColumnsException(_profileColumns);
 }