public void Fail_When_Input_Is_Invalid(IEnumerable <TranslationEntity> input, bool isValid, string _) { // Arrange var subject = new TranslationJsonGenerator(); // Act var intermediateResult = subject.GenerateJsonString(input.ToList()); // Assert intermediateResult.IsSuccess.Should().Be(isValid); }
public void Generate_Output_That_Reflects_The_Input(IEnumerable <TranslationEntity> input) { // Arrange var subject = new TranslationJsonGenerator(); // Act var jsonResult = subject.GenerateJsonString(input.ToList()); var objFromJson = JsonConvert.DeserializeObject <JObject>(jsonResult.Value); var output = GetTranslations(objFromJson); // Assert output.Should().BeEquivalentTo(input); }
public void Return_Correct_Validation_Messages_When_Input_Is_Invalid(IEnumerable <TranslationEntity> input, bool _, string validationMessage) { // Arrange var subject = new TranslationJsonGenerator(); // Act var intermediateResult = subject.GenerateJsonString(input.ToList()); // Assert if (!intermediateResult.IsSuccess) { intermediateResult.Error.Message.Should().Be(validationMessage); } }