コード例 #1
0
 public Comment GetById(int id)
 {
     return(new Comment
     {
         Id = id,
         Description = "Something Something by id",
         SurveyId = MockRandom.Random().Next(100),
         UserId = new int().ToString()
     });
 }
コード例 #2
0
 public ICollection <Customer> GetAll()
 {
     return(new List <Customer>
     {
         GetById(MockRandom.Random().Next(100)),
         GetById(MockRandom.Random().Next(100)),
         GetById(MockRandom.Random().Next(100)),
         GetById(MockRandom.Random().Next(100))
     });
 }
コード例 #3
0
 ICollection <Comment> ICommentService.GetByUserId(string id)
 {
     return(new List <Comment>
     {
         new Comment
         {
             Id = MockRandom.Random().Next(100),
             Description = "Something Something by user",
             SurveyId = new int(),
             UserId = id
         }
     });
 }
コード例 #4
0
 public ICollection <Comment> GetBySurveyId(int id)
 {
     return(new List <Comment>
     {
         new Comment
         {
             Id = MockRandom.Random().Next(100),
             Description = "Something Something by survey",
             SurveyId = id,
             UserId = new int().ToString()
         }
     });
 }
コード例 #5
0
 public SectionGroup GetById(int id)
 {
     return(new SectionGroup
     {
         Id = id,
         IsMandatory = MockRandom.Random().NextDouble() > 0.5,
         SurveyTemplateId = MockRandom.Random().Next(100),
         SortOrder = MockRandom.Random().Next(100),
         Title = "Section Group Mock" + id,
         Section = new List <Section>()
         {
             new SectionServiceMock().GetById(MockRandom.Random().Next(100)),
             new SectionServiceMock().GetById(MockRandom.Random().Next(100))
         }.OrderBy(m => m.SortOrder).ToList()
     });
 }
コード例 #6
0
 public Section GetById(int id)
 {
     return(new Section
     {
         Id = id,
         Title = "Mock Section" + id,
         Description = "Mock Description of section",
         SectionGroupId = MockRandom.Random().Next(100),
         SortOrder = MockRandom.Random().Next(100),
         Question = new List <Question>
         {
             new QuestionServiceMock().GetById(MockRandom.Random().Next(100)),
             new QuestionServiceMock().GetById(MockRandom.Random().Next(100)),
             new QuestionServiceMock().GetById(MockRandom.Random().Next(100))
         }
     });
 }
コード例 #7
0
        public Survey GetById(int id)
        {
            var currentState = new SurveyState {
                Id = 1, Name = "Created"
            };
            var currentCustomer = new Customer {
                Id = MockRandom.Random().Next(100), Name = "Customer 1"
            };

            return(new Survey
            {
                Id = id,
                SurveyTemplateId = MockRandom.Random().Next(100),
                SurveyState = currentState,
                Customer = currentCustomer,
                UserId = MockRandom.Random().Next(100).ToString()
            });
        }
コード例 #8
0
 public SurveyTemplate GetById(int id)
 {
     return(new SurveyTemplate
     {
         CreatedBy = "Mock",
         TaskDetails = "Some kind of description",
         Title = "Base Survey Template",
         Id = id,
         Description = "Another kind of description",
         OwnerId = new OwnerServiceMock().GetById(MockRandom.Random().Next(100)).Id,
         SurveyTypeId = new SurveyTypeServiceMock().GetById(1).Id,
         SectionGroup = new List <SectionGroup>()
         {
             new SectionGroupServiceMock().GetById(MockRandom.Random().Next(100)),
             new SectionGroupServiceMock().GetById(MockRandom.Random().Next(100)),
             new SectionGroupServiceMock().GetById(MockRandom.Random().Next(100))
         }.OrderBy(m => m.SortOrder).ToList()
     });
 }
コード例 #9
0
        public Question GetById(int id)
        {
            var questionType = MockRandom.Random().Next(3);
            var optionGroup  = new OptionGroupServiceMock().GetById(questionType);

            return(new Question
            {
                Id = id,
                IsMandatory = MockRandom.Random().NextDouble() > 0.5,
                AnswerLabel = "Answer Me!!",
                DefaultComments = "Should this be updated after the answer?",
                HelpText = "This is the easiest question ever",
                QuestionText = "How much is " + MockRandom.Random().Next(10) + " + " + MockRandom.Random().Next(10),
                SectionId = MockRandom.Random().Next(100),
                AnswerValidationExpression = "42 the answer of everything",
                OptionGroupId = new OptionGroupServiceMock().GetById(MockRandom.Random().Next(3)).Id,
                OptionGroup = optionGroup,
                QuestionTypeId = questionType
            });
        }
コード例 #10
0
        public List <Survey> GetByUserId(string userId)
        {
            var result       = new List <Survey>();
            var currentState = new SurveyState {
                Id = 1, Name = "Created"
            };
            var currentCustomer = new Customer {
                Id = MockRandom.Random().Next(100), Name = "Customer 1"
            };

            result.Add(new Survey
            {
                Id = MockRandom.Random().Next(100),
                SurveyTemplateId = MockRandom.Random().Next(100),
                SurveyState      = currentState,
                Customer         = currentCustomer,
                UserId           = userId
            });
            result.Add(new Survey
            {
                Id = MockRandom.Random().Next(100),
                SurveyTemplateId = MockRandom.Random().Next(100),
                SurveyState      = currentState,
                Customer         = currentCustomer,
                UserId           = userId
            });
            result.Add(new Survey
            {
                Id = MockRandom.Random().Next(100),
                SurveyTemplateId = MockRandom.Random().Next(100),
                SurveyState      = currentState,
                Customer         = currentCustomer,
                UserId           = userId
            });
            return(result);
        }
コード例 #11
0
 public ICollection <AnswerGroup> GetBySurveyId(int id)
 {
     return(new List <AnswerGroup>
     {
         new AnswerGroup {
             Id = MockRandom.Random().Next(100), SurveyId = id, SectionGroupId = MockRandom.Random().Next(100)
         }
     });
 }
コード例 #12
0
 public AnswerGroup GetBySectionGroupId(int id)
 {
     return(new AnswerGroup {
         Id = MockRandom.Random().Next(100), SurveyId = new int(), SectionGroupId = id
     });
 }
コード例 #13
0
        private string RandomEnumValue <T>()
        {
            var v = Enum.GetValues(typeof(T));

            return((string)v.GetValue(MockRandom.Random().Next(v.Length)));
        }
コード例 #14
0
 public Owner GetOwnerForSurveyId(int id)
 {
     return(GetById(MockRandom.Random().Next(100)));
 }
コード例 #15
0
 public Customer GetById(int id)
 {
     return(new Customer {
         Id = MockRandom.Random().Next(100), Name = "CustomerName" + id, Telephone = "91 91 91 91"
     });
 }