示例#1
0
        public void Setup()
        {
            _sut           = new SpecialOwnerRepository(new ConnectionString());
            _specialOwners = new List <SpecialOwnerDto>();

            CreateAndInsertData(_sut, _specialOwners);
        }
示例#2
0
        public void Setup()
        {
            _sut = new SpecialOwnerRepository(new ConnectionString());

            _expected = new SpecialOwnerDto
            {
                CreatedBy = "user1",
                Name      = "Special one",
                Remark    = "I'm special"
            };

            _expected.Id = _sut.Insert(_expected);
        }
示例#3
0
        private static void CreateAndInsertData(SpecialOwnerRepository repo, List <SpecialOwnerDto> specialOwners)
        {
            var timeStamp = new DateTime(2020, 04, 25, 23, 30, 00);

            for (int i = 0; i < 5; i++)
            {
                DateTimeProvider.SetDateTime(timeStamp);

                var owner = new SpecialOwnerDto
                {
                    CreatedBy = "user" + i,
                    Name      = "special" + i
                };

                owner.Id = repo.Insert(owner);
                specialOwners.Add(owner);

                timeStamp = timeStamp.AddDays(1);
            }
        }
示例#4
0
        public void Setup()
        {
            _sut = new SpecialOwnerRepository(new ConnectionString());

            _expected = new List <SpecialOwnerDto>
            {
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "Special one",
                    Remark    = "I'm special"
                },
                new SpecialOwnerDto
                {
                    CreatedBy = "user2",
                    Name      = "The default one"
                                // Don't set the remark
                }
            };
        }
        public void Setup()
        {
            _sut = new SpecialOwnerRepository(new ConnectionString());

            DateTimeProvider.SetDateTime(new DateTime(2020, 04, 25, 23, 30, 00));

            _specialOwners = new List <SpecialOwnerDto>()
            {
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "special1"
                },
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "special2",
                    Remark    = "remark2"
                },
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "special3",
                    Remark    = "remark3"
                },
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "special4"
                },
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "special5"
                },
            };

            _specialOwners.ForEach(x => x.Id = _sut.Insert(x));
        }
        public void Setup()
        {
            _sut = new SpecialOwnerRepository(new ConnectionString());

            _expected = new List <SpecialOwnerDto>()
            {
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "Special 1"
                },
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "Special 2",
                    Remark    = "Remark 2"
                },
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "Special 3",
                    Remark    = "Remark 3"
                },
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "Special 4"
                },
                new SpecialOwnerDto
                {
                    CreatedBy = "user1",
                    Name      = "Special 5"
                },
            };

            _expected.ForEach(x => x.Id = _sut.Insert(x));
        }
示例#7
0
 public void Setup() =>
 _sut = new SpecialOwnerRepository(new ConnectionString());