Beispiel #1
0
        public void SaveAndGet()
        {
            IManufacturerRepository iManufacturer = new ManufacturerRepository(this.connectionString);
            string name = Guid.NewGuid().ToString().Substring(0, 6);

            int manufacturerSavedId = iManufacturer.Save(name);
            int?manufacturerGetId   = iManufacturer.Find(name);

            Assert.IsNotNull(manufacturerGetId);
            Assert.IsTrue(manufacturerSavedId == manufacturerGetId.Value);
        }
        public void SaveAndGet()
        {
            IManufacturerRepository iManufacturer = new ManufacturerRepository(this.connectionString);
            string name = Guid.NewGuid().ToString().Substring(0, 6);

            int manufacturerSavedId = iManufacturer.Save(name);
            int? manufacturerGetId = iManufacturer.Find(name);

            Assert.IsNotNull(manufacturerGetId);
            Assert.IsTrue(manufacturerSavedId == manufacturerGetId.Value);
        }
Beispiel #3
0
        public async Task TestManufacturerRepo_GetSingle()
        {
            //Arrange
            ManufacturerRepository TestRepo = CreateManufacturerTestRepo("ManufacturerGetSingle");

            //Act
            var result = await TestRepo.Find(_ManufacturerNumber - 1);  //Subtract one since it starts at 0

            //Assert
            Assert.IsTrue(result.Id == (_ManufacturerNumber - 1));
            Assert.IsTrue(result.Name == _ManufacturerName + (_ManufacturerNumber - 1).ToString());
        }