title: How to assign a value to a DateTimeOffset data type
body: <p>Sorry for the noob question, I am trying to learn TDD. I have a program that will check to see if a specific time is used. I have declared the time using the DateTimeOffset DataType and I am not sure how to reference it in the test. Here is the code I have.</p>
  
  <p>Model:</p>
  
  <pre><code>namespace Attendance.Models
  {
      public class Student
      {
          public string Name { get; set; }
          public DateTime DOB { get; set; }
          public string DayOfWeek { get; set; }
          public int Age { get; set;}
          public DateTimeOffset Time { get; set; }
          public string StreetAddress { get; set; }
          public string City { get; set; }
          public string State { get; set; }
          public string ZipCode { get; set; }
          public string HomePhone { get; set; }
      }
  }
  </code></pre>
  
  <p>Test Controller:</p>
  
  <pre><code>[TestMethod]
          public void FindByTimeSlotReturnsStudentsInSlot()
          { 
              // Arrange
              var StudentRepository = Mock.Create&lt;Repository&gt;();
              Mock.Arrange( () =&gt; StudentRepository.GetAll()).Returns(
                  new List&lt;Student&gt;()
          {
              new Student {Name = "Bob Smith", DayOfWeek = "Monday", Time = "10:40:00" },
              new Student {Name = "Mike Jones", DayOfWeek = "Wednesday", Time = "11:20:00" },
              new Student {Name = "Mary Jane", DayOfWeek = "Wednesday", Time = "11:20:00" },
              new Student {Name = "Albert Einstein", DayOfWeek = "Tuesday", Time = "12:15:00" },
              new Student {Name = "Fred Flintsone", DayOfWeek = "Monday", Time = "10:40:00" },
          }).MustBeCalled();
  
              // Act
              HomeController controller = new HomeController(StudentRepository);
              ViewResult viewResult = controller.FindByDayOfWeek("Monday");
              var model = viewResult.Model as IEnumerable&lt;Student&gt;;
  
              // Assert
              Assert.AreEqual(2, model.Count());
              Assert.AreEqual("Bob Smith", model.ToList()[0].Name);
              Assert.AreEqual("Monday", model.ToList()[0].DayOfWeek);
  </code></pre>
  
  <p>The error is on the Time = "10:40:00", which tells me that I cannot convert a DateTime to a string. I have also tried 10,40,00, (Unexpected interger) and 10:40:00 (Syntax error "," expected)</p>
  
  <p>Any ideas would be awesome.</p>