Example #1
0
        public void PhotosPut()
        {
            PhotosController photosController = new PhotosController();

            Photos photos = new Photos();

            photos.UserId = 2;
            photos.Name   = "test";
            photos.Width  = 1;
            photos.Height = 1;
            photos.Size   = 1;
            photos.Date   = DateTime.Now;

            HttpResponseMessage i = photosController.Put(1, photos);

            Assert.AreEqual(i.RequestMessage, "No content.");
            //Assert.AreEqual(1, 1);
        }
Example #2
0
        public void Put_PassingRaceData_FillsInDataFields()
        {
            //Arrange
            string expected    = "FillsInDataFields";
            var    photoRecord = fakeDataSource.Photos.FindAll().FirstOrDefault();
            var    photoData   = AutoMapper.Mapper.Map <Photo, PhotoData>(photoRecord);

            photoData.Event    = "Test";
            photoData.Station  = "FinishLine";
            photoData.Card     = "1";
            photoData.Sequence = 1;
            //Act

            target.Put(photoRecord.Id, photoData);

            //Assert
            var resultPhotoRecord = fakeDataSource.Photos.FindById(photoRecord.Id);

            Assert.IsNotNull(resultPhotoRecord);
            Assert.AreEqual(1, resultPhotoRecord.EventId, "Event");
            Assert.AreEqual("FinishLine", resultPhotoRecord.Station, "Station");
            Assert.AreEqual("1", resultPhotoRecord.Card, "Card");
            Assert.AreEqual(1, resultPhotoRecord.Sequence, "Sequence");
        }