コード例 #1
0
ファイル: StudioValidatorTests.cs プロジェクト: meutley/ISTS
        public StudioValidatorTests()
        {
            _postalCodeValidator = new Mock <IPostalCodeValidator>();
            _studioRepository    = new Mock <IStudioRepository>();

            _studioValidator = new StudioValidator(_postalCodeValidator.Object, _studioRepository.Object);
        }
コード例 #2
0
        public void Update(string name, string friendlyUrl, string postalCode, IStudioValidator studioValidator)
        {
            AsyncHelper.RunSync(() => studioValidator.ValidateAsync(this.Id, name, friendlyUrl, postalCode));

            this.Name        = name;
            this.FriendlyUrl = friendlyUrl;
            this.PostalCode  = postalCode;
        }
コード例 #3
0
ファイル: StudioService.cs プロジェクト: meutley/ISTS
 public StudioService(
     IStudioValidator studioUrlValidator,
     IStudioRepository studioRepository,
     IPostalCodeRepository postalCodeRepository,
     IUserRepository userRepository,
     IMapper mapper)
 {
     _studioUrlValidator   = studioUrlValidator;
     _studioRepository     = studioRepository;
     _postalCodeRepository = postalCodeRepository;
     _userRepository       = userRepository;
     _mapper = mapper;
 }
コード例 #4
0
        public static Studio Create(
            string name,
            string friendlyUrl,
            string postalCode,
            Guid ownerUserId,
            IStudioValidator studioValidator)
        {
            AsyncHelper.RunSync(() => studioValidator.ValidateAsync(null, name, friendlyUrl, postalCode));

            var result = new Studio
            {
                Id          = Guid.NewGuid(),
                Name        = name,
                FriendlyUrl = friendlyUrl,
                Rooms       = new List <Room>(),
                OwnerUserId = ownerUserId,
                PostalCode  = postalCode
            };

            return(result);

            throw new InvalidOperationException();
        }