Exemple #1
0
        public void SetProfileInfo_ThrowArgumentNullException_When_UserIdNotSpecifiedInRequest()
        {
            var dto = new DTO.ProfileInfoModel {
                ProfileInfo = this.validProfileInfo
            };

            Assert.ThrowsAsync <ArgumentNullException>(() => this.subject.SetProfileInfo(dto));
        }
Exemple #2
0
        public async Task SetProfileInfo_ReturnBadData_When_PassingValidProfileInfoButInvalidUserId()
        {
            this.SetUserIdToRequest(this.invalidUserId);
            var dto = new DTO.ProfileInfoModel {
                ProfileInfo = this.validProfileInfo
            };
            Value result = await this.subject.SetProfileInfo(dto);

            Assert.AreEqual(result.Type, (int)ProfileController.ValueType.BadData);
            this.mockProfileRepository.Verify(c => c.SetProfileInfoAsync(this.invalidUserId, this.validProfileInfo));
        }
Exemple #3
0
        public async Task SetProfileInfo_ReturnSuccess_When_PassingValidProfileInfoThroughValidatorsAndUpdated()
        {
            this.SetUserIdToRequest(this.validUserId);
            var dto = new DTO.ProfileInfoModel {
                ProfileInfo = this.validProfileInfo
            };
            Value result = await this.subject.SetProfileInfo(dto);

            Assert.AreEqual(result.Type, (int)ProfileController.ValueType.Success);
            this.mockProfileRepository.Verify(c => c.SetProfileInfoAsync(this.validUserId, this.validProfileInfo));
        }