コード例 #1
0
        public void GetReturnById()
        {
            var mockContext = this.GetMockContext();
            var service = new PersonService(mockContext.Object);

            var actual = service.Get(1);

            actual.Name.ShouldBe("Willis Tibbs");
            actual.IsEnabled.ShouldBeTrue();
            actual.IsAuthorised.ShouldBeTrue();
            actual.Colours.Count.ShouldBe(3);
        }
コード例 #2
0
        public void GetAllBriefReturnsACollection()
        {
            var mockContext = this.GetMockContext();
            var service = new PersonService(mockContext.Object);

            var actual = service.GetAllBrief().ToList();

            actual.Count().ShouldBe(3);
            actual.First().Name.ShouldBe("Willis Tibbs");
            actual.First().IsEnabled.ShouldBeTrue();
            actual.First().IsAuthorised.ShouldBeTrue();
            actual.First().Colours.ShouldBe("Red, Green, Blue");
        }