/Source/Bifrost.Specs/Views/for_View/when_getting_a_single_instance_of_object_without_id.cs

# · C# · 15 lines · 13 code · 2 blank · 0 comment · 0 complexity · 2293c8da6fbd2fd8cbb8fe38aff9a4ab MD5 · raw file

  1. using System;
  2. using Bifrost.Views;
  3. using Machine.Specifications;
  4. namespace Bifrost.Specs.Views.for_View
  5. {
  6. [Subject(Subjects.getting_single_instance)]
  7. public class when_getting_a_single_instance_of_object_without_id : given.a_view_for<SimpleObjectWithoutId>
  8. {
  9. static Exception exception;
  10. Because of = () => exception = Catch.Exception(() => Repository.Get(Guid.NewGuid()));
  11. It should_throw_object_does_not_have_id_exception = () => exception.ShouldBeOfType<ObjectDoesNotHaveIdException>();
  12. }
  13. }