public void Generate_WhenCalledWithNull_ThrowsArgumentNullException() { var fakedHashService = GetFakedHashService(); var generator = new HashMemberNameGenerator(fakedHashService); Assert.Throws<ArgumentNullException>(() => generator.Generate(null)); }
public void Generate_WhenPassedValueLengthIsLessThanMemberPathSubstringLength_CompleteValuePlusHashIsReturned() { var fakedHashService = GetFakedHashService(); var generator = new HashMemberNameGenerator(fakedHashService); var inputValue = new string('a', generator.MemberPathSubstringLength - 1); var memberName = generator.Generate(inputValue); Assert.AreEqual(inputValue + "_" + FakedHash, memberName); }
public void MemberPathSubstringLength_WhenHashLengthIs8_CalculatedTo119_SinceDelimTakesOne() { var fakedHashService = new Mock<IHashService>(); fakedHashService.Setup(x => x.GetHashLength()).Returns(8); var generator = new HashMemberNameGenerator(fakedHashService.Object); Assert.AreEqual(119, generator.MemberPathSubstringLength); }