Example #1
0
        public void TestCanViewOrigins()
        {
            var origins        = FakeOrigins.Get().AsQueryable();
            var visibleOrigins = origins.CanViewContent(FakeUsers.GetPublic().AsModel());

            visibleOrigins.Should().HaveCount(1);
        }
Example #2
0
        public static Mock <IOriginService> GetStandardMockOriginService(IEnumerable <Origin> originsResult = null)
        {
            var mockOriginService = new Mock <IOriginService>();

            mockOriginService.Setup(s => s.GetOriginAsync(It.IsAny <int>()))
            .ReturnsAsync(originsResult?.FirstOrDefault() ?? FakeOrigins.Get().First().AsModel());

            return(mockOriginService);
        }