示例#1
0
        public void GetFirstParagraph_ShoulReturn_CorrectString(string name, string surname, string expected)
        {
            var constant = new Mock <IConstants>();

            constant.Setup(s => s.GetDiplomNameText).Returns("Diploma \n\n Studii Medii");
            var stringCreator = new StringCreatorBuilder().WithConstants(constant).Build();
            var act           = stringCreator.GetFirstParagraph(name, surname);

            Assert.Equal(expected, act);
        }
示例#2
0
        public void CreatePath_ShouldReturn_CorrectString(string name, string surname)
        {
            var domain    = new Mock <IDomainWrapper>();
            var constants = new Mock <IConstants>();

            constants.Setup(c => c.GetExtension).Returns(".docx");
            domain.Setup(d => d.GetRoothDirectory()).Returns(AppDomain.CurrentDomain.BaseDirectory);
            var sut = new StringCreatorBuilder().WithDomain(domain).WithConstants(constants).Build();

            var act      = sut.CreatePath(name, surname);
            var expected = AppDomain.CurrentDomain.BaseDirectory + name + surname + ".docx";

            Assert.Equal(expected, act);
        }
示例#3
0
        public void GetSecondParagraphText_ShoultReturn_CorrectString(string subject, double grade, string expected)
        {
            var     stringCreator  = new StringCreatorBuilder().Build();
            Subject subjectexample = new Subject {
                SubjectName = subject, Grade = grade
            };

            List <Subject> subjects = new List <Subject>
            {
                subjectexample
            };

            var act = stringCreator.GetSecondParagraphText(subjects);

            act.Should().BeEquivalentTo(expected);
        }