Example #1
0
        public async Task <ActionResult <Residance> > PostResidance(Residance residance)
        {
            _context.residances.Add(residance);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetResidance", new { id = residance.Id }, residance));
        }
Example #2
0
        public async Task <IActionResult> PutResidance(int id, Residance residance)
        {
            if (id != residance.Id)
            {
                return(BadRequest());
            }

            _context.Entry(residance).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ResidanceExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #3
0
        public void Boundary_Testfor_ValidZipNumber()
        {
            //Action
            //Action
            var residance = new Residance()
            {
                QuoteId      = "Q1",
                AddressLine1 = "Bangalore",
                City         = "Bangalore",
                Zip          = 675201
            };

            //Assert
            Assert.Equal(6, residance.Zip.ToString().Length);
        }
Example #4
0
        public void Test_For_Valid_ApplyQoute()
        {
            //Arrange Qoute ApplyQoute(Residance residance,Property property);
            var residance = new Residance()
            {
                QuoteId      = "Q1",
                AddressLine1 = "Bangalore",
                City         = "Bangalore",
                Zip          = 675201
            };
            var property = new Property()
            {
                PropertyId = 12345,
                QouteId    = "q1",
                UserId     = 1234
            };

            //Action
            var getQoute = _service.ApplyQoute(residance, property);

            //Assert
            Assert.NotNull(getQoute);
        }
 public Qoute ApplyQoute(Residance residance, Property property)
 {
     throw new NotImplementedException();
 }