Beispiel #1
0
        public void ThenTheDataIsInserted()
        {
            _expected.ToList().ForEach(x => x.Id = _sut.Insert(x));

            foreach (var dto in _expected)
            {
                AssertDto(dto);
            }
        }
Beispiel #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);
        }
Beispiel #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);
            }
        }
        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
                }
            };

            _expected.ForEach(x => x.Id = _sut.Insert(x));
        }
        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));
        }