public void Contructor()
        {
            var rootLinksBuilder = new Mock <IRootLinksBuilder>().Object;

            ConstructorTests <ApiRootHeadController>
            .For(typeof(IRootLinksBuilder))
            .Fail(new object[] { null }, typeof(ArgumentNullException), "Null RootLinksBuilder")
            .Succeed(new object[] { rootLinksBuilder }, "Constructor args valid")
            .Assert();
        }
        public void Constructor()
        {
            var next = new Mock <IReadPageService <Uom> >().Object;

            ConstructorTests <ReadPageService <Uom> >
            .For(typeof(IReadPageService <Uom>))
            .Fail(new object[] { null }, typeof(ArgumentNullException), "Null next")
            .Succeed(new object[] { next }, "Constructor args valid.")
            .Assert();
        }
 public void Contructor()
 {
     ConstructorTests <UrlBases>
     .For(typeof(string), typeof(string))
     .Fail(new object[] { "http://local", "" }, typeof(ArgumentException), "Bad Write Url")
     .Fail(new object[] { "", "http://local" }, typeof(ArgumentException), "Bad Read Url")
     .Fail(new object[] { "", "" }, typeof(ArgumentException), "Bad Read and Write Urls")
     .Succeed(new object[] { "http://local", "http://local" }, "Constructor args valid")
     .Assert();
 }
        public void Constructor()
        {
            var next = new Mock <IHttpService>().Object;

            ConstructorTests <HttpWriteService>
            .For(typeof(IHttpService))
            .Fail(new object[] { null }, typeof(ArgumentNullException), "Null next")
            .Succeed(new object[] { next }, "Constructor args valid.")
            .Assert();
        }
Esempio n. 5
0
        public void Contructor()
        {
            var sfServices = new Mock <IOptions <SfServices> >().Object;

            ConstructorTests <UrlBaseBuilder>
            .For(typeof(IOptions <SfServices>))
            .Fail(new object[] { null }, typeof(ArgumentNullException), "Null Options<SfServices>")
            .Succeed(new object[] { sfServices }, "Constructor args valid")
            .Assert();
        }
        public void Constructor()
        {
            var httpService = new Mock <IHttpWriteService>().Object;

            ConstructorTests <DeleteItemServiceBuildRequest>
            .For(typeof(IHttpWriteService))
            .Fail(new object[] { null }, typeof(ArgumentNullException), "Null httpService.")
            .Succeed(new object[] { httpService }, "Constructor args valid.")
            .Assert();
        }
        public void Constructor()
        {
            var repository = new Mock <IWriteRepository <TestEntity> >().Object;

            ConstructorTests <WriteController <TestEntity> >
            .For(typeof(IWriteRepository <TestEntity>))
            .Fail(new object[] { null }, typeof(ArgumentNullException), "Null repostory.")
            .Succeed(new object[] { repository }, "Constructor args valid.")
            .Assert();
        }
        public void Constructor()
        {
            var client = new Mock <IHttpClient>().Object;

            ConstructorTests <HttpServiceSendRequest>
            .For(typeof(IHttpClient))
            .Fail(new object[] { null }, typeof(ArgumentNullException), "Null next")
            .Succeed(new object[] { client }, "Constructor args valid.")
            .Assert();
        }
        public void Constructor()
        {
            var mockController = new Mock <IJwtTokenSource>().Object;
            var mockSerializer = new Mock <IContentSerializer>().Object;

            ConstructorTests <HttpRequestBuilder>
            .For(typeof(IJwtTokenSource), typeof(IContentSerializer))
            .Fail(new object[] { mockController, null }, typeof(ArgumentNullException), "Null Serializer")
            .Fail(new object[] { null, mockSerializer }, typeof(ArgumentNullException), "Null Controller")
            .Succeed(new object[] { mockController }, "Valid Constructor.");
        }
Esempio n. 10
0
        public void Constructor()
        {
            var goodUrl = Url;
            var badUrl  = "asdf";

            ConstructorTests <ApiEndpoint>
            .For(typeof(string))
            .Fail(new object[] { badUrl }, typeof(ArgumentException), "Bad url")
            .Succeed(new object[] { goodUrl }, "Constructor args valid.")
            .Assert();
        }
        public void Constructor()
        {
            var acceptedMedia = new Mock <IAcceptedMediaSource>().Object;
            var next          = new Mock <IHttpService>().Object;

            ConstructorTests <HttpServiceAddAcceptHeader>
            .For(typeof(IAcceptedMediaSource), typeof(IHttpService))
            .Fail(new object[] { null, next }, typeof(ArgumentNullException), "Null acceptedMedia")
            .Fail(new object[] { acceptedMedia, null }, typeof(ArgumentNullException), "Null next")
            .Succeed(new object[] { acceptedMedia, next }, "Constructor args valid.")
            .Assert();
        }
Esempio n. 12
0
        public void Contructor()
        {
            var readRepository   = new Mock <IReadRepository <TestEntity> >().Object;
            var pageLinksBuilder = new Mock <IPageLinksBuilder>().Object;

            ConstructorTests <ReadController <TestEntity> >
            .For(typeof(IReadRepository <TestEntity>), typeof(IPageLinksBuilder))
            .Fail(new object[] { readRepository, null }, typeof(ArgumentNullException), "Null PageLinksBuilder")
            .Fail(new object[] { null, pageLinksBuilder }, typeof(ArgumentNullException), "Null Respository")
            .Succeed(new object[] { readRepository, pageLinksBuilder }, "Constructor args valid")
            .Assert();
        }
        public void Constructor()
        {
            var items = new Mock <IImmutableList <Uom> >().Object;
            var links = new PageLinksFormatter().GetLinks(Url, new Page <Uom>("", 40, 0, 10, new List <Uom>()));

            ConstructorTests <CollectionPageData <Uom> >
            .For(typeof(IImmutableList <Uom>), typeof(string))
            .Fail(new object[] { items, null }, typeof(ArgumentNullException), "Null links")
            .Fail(new object[] { null, links }, typeof(ArgumentNullException), "Null items")
            .Succeed(new object[] { items, links }, "Constructor args valid.")
            .Assert();
        }
        public void Constructor()
        {
            var urlBuilder = new Mock <IItemWriteUrlBuilder <Uom> >().Object;
            var next       = new Mock <IDeleteItemServiceBuildRequest>().Object;

            ConstructorTests <DeleteItemServiceBuildUrl <Uom> >
            .For(typeof(IItemWriteUrlBuilder <Uom>), typeof(IDeleteItemServiceBuildRequest))
            .Fail(new object[] { null, next }, typeof(ArgumentNullException), "Null urlBuilder.")
            .Fail(new object[] { urlBuilder, null }, typeof(ArgumentNullException), "Null next.")
            .Succeed(new object[] { urlBuilder, next }, "Constructor args valid.")
            .Assert();
        }
Esempio n. 15
0
        public void Contructor()
        {
            var urlBaseBuilder     = new Mock <IUrlBaseBuilder>().Object;
            var pageLinksFormatter = new Mock <IPageLinksFormatter>().Object;

            ConstructorTests <PageLinksBuilder>
            .For(typeof(IUrlBaseBuilder), typeof(IPageLinksFormatter))
            .Fail(new object[] { null, pageLinksFormatter }, typeof(ArgumentNullException), "Null UrlBaseBuilder")
            .Fail(new object[] { urlBaseBuilder, null }, typeof(ArgumentNullException), "Null PageLinksFormatter")
            .Succeed(new object[] { urlBaseBuilder, pageLinksFormatter }, "Constructor args valid")
            .Assert();
        }
Esempio n. 16
0
        public void Constructor()
        {
            var saveService = new Mock <ISaveItemService <Uom> >().Object;
            var readService = new Mock <IReadItemService <Uom> >().Object;

            ConstructorTests <UomItemViewModel>
            .For(typeof(ISaveItemService <Uom>), typeof(IReadItemService <Uom>))
            .Fail(new object[] { null, readService }, typeof(ArgumentNullException), "Null saveService.")
            .Fail(new object[] { saveService, null }, typeof(ArgumentNullException), "Null readService.")
            .Succeed(new object[] { saveService, readService }, "Constructor args valid.")
            .Assert();
        }
        public void Constructor()
        {
            var templateKey = "key";
            var lookup      = new Mock <ILinkTemplateLookup>().Object;

            ConstructorTests <ItemUrlBuilder <Uom> >
            .For(typeof(string), typeof(ILinkTemplateLookup))
            .Fail(new object[] { null, lookup }, typeof(ArgumentException), "Null templateKey")
            .Fail(new object[] { templateKey, null }, typeof(ArgumentNullException), "Null templateKey")
            .Succeed(new object[] { templateKey, lookup }, "Constructor args valid.")
            .Assert();
        }
Esempio n. 18
0
        public void Constructor()
        {
            var tokenSource = new Mock <IJwtTokenSource>().Object;
            var next        = new Mock <IHttpService>().Object;

            ConstructorTests <HttpServiceAddAuthorizationHeader>
            .For(typeof(IJwtTokenSource), typeof(IHttpService))
            .Fail(new object[] { tokenSource, null }, typeof(ArgumentNullException), "Null next")
            .Fail(new object[] { null, next }, typeof(ArgumentNullException), "Null tokenSource")
            .Succeed(new object[] { tokenSource, next }, "Constructor args valid.")
            .Assert();
        }
        public void Constructor()
        {
            var validator = new Mock <IValidator>().Object;
            var next      = new Mock <ISaveItemService <Uom> >().Object;

            ConstructorTests <SaveItemServiceValidate <Uom> >
            .For(typeof(IValidator), typeof(ISaveItemService <Uom>))
            .Fail(new object[] { null, next }, typeof(ArgumentNullException), "Null validator")
            .Fail(new object[] { validator, null }, typeof(ArgumentNullException), "Null next")
            .Succeed(new object[] { validator, next }, "Constructor args valid.")
            .Assert();
        }
        public void Constructor()
        {
            var httpService  = new Mock <IHttpReadService>().Object;
            var deserializer = new Mock <IContentDeserializer>().Object;

            ConstructorTests <ReadItemServiceBuildRequest <Uom> >
            .For(typeof(IHttpReadService), typeof(IContentDeserializer))
            .Fail(new object[] { null, deserializer }, typeof(ArgumentNullException), "Null httpService")
            .Fail(new object[] { httpService, null }, typeof(ArgumentNullException), "Null deserializer")
            .Succeed(new object[] { httpService, deserializer }, "Constructor args valid.")
            .Assert();
        }
Esempio n. 21
0
        public void Constructor()
        {
            var apiEndPoint        = new Mock <IEndPoint>().Object;
            var httpRequestBuilder = new Mock <IHttpRequestBuilder>().Object;
            var httpClient         = new Mock <IHttpReadClient>().Object;

            ConstructorTests <QTB3.Client.Common.Services.LinkService.LinkService>
            .For(typeof(IEndPoint), typeof(IHttpRequestBuilder), typeof(IHttpReadClient))
            .Fail(new object[] { null, httpRequestBuilder, httpClient }, typeof(ArgumentNullException), "apiEndpoint")
            .Fail(new object[] { apiEndPoint, null, httpClient }, typeof(ArgumentNullException), "httpRequestBuilder")
            .Fail(new object[] { apiEndPoint, httpRequestBuilder, null }, typeof(ArgumentNullException), "httpClient")
            .Succeed(new object[] { apiEndPoint, httpRequestBuilder, httpClient }, "Constructor args valid.")
            .Assert();
        }
        public void Constructor()
        {
            var pageTitle       = "Home";
            var readPageService = new Mock <IReadPageService <Uom> >().Object;
            var newPageService  = new Mock <IReadPageServiceNewPage <Uom> >().Object;
            var deleteService   = new Mock <IDeleteItemService <Uom> >().Object;

            ConstructorTests <CollectionPageViewModel <Uom> >
            .For(typeof(string), typeof(IReadPageService <Uom>), typeof(IReadPageServiceNewPage <Uom>), typeof(IDeleteItemService <Uom>))
            .Fail(new object[] { string.Empty, readPageService, newPageService, deleteService }, typeof(ArgumentException), "Empty Title.")
            .Fail(new object[] { pageTitle, null, newPageService, deleteService }, typeof(ArgumentNullException), "Null readPageService.")
            .Fail(new object[] { pageTitle, readPageService, null, deleteService }, typeof(ArgumentNullException), "Null newPageService.")
            .Fail(new object[] { pageTitle, readPageService, newPageService, null }, typeof(ArgumentNullException), "Null deleteService.")
            .Succeed(new object[] { pageTitle, readPageService, newPageService, deleteService }, "Constructor args valid.")
            .Assert();
        }
        public void Constructor()
        {
            var createItemViewModel      = new Mock <Func <IItemViewModel <Uom> > >().Object;
            var createItemPage           = new Mock <Func <IItemPage <Uom> > >().Object;
            var createItemPageController = new Mock <Func <ILrpNavigation, IItemViewModel <Uom>, IItemPage <Uom>, IItemPageController <Uom> > >().Object;

            ConstructorTests <ItemMvcBuilder <Uom> >
            .For
            (
                typeof(Func <IItemViewModel <Uom> >),
                typeof(Func <IItemPage <Uom> >),
                typeof(Func <ILrpNavigation, IItemViewModel <Uom>, IItemPage <Uom>, IItemPageController <Uom> >)
            )
            .Fail(new object[] { null, createItemPage, createItemPageController }, typeof(ArgumentNullException), "Null createItemViewModel.")
            .Fail(new object[] { createItemViewModel, null, createItemPageController }, typeof(ArgumentNullException), "Null createItemPage.")
            .Fail(new object[] { createItemViewModel, createItemPage, null }, typeof(ArgumentNullException), "Null createItemPageController.")
            .Succeed(new object[] { createItemViewModel, createItemPage, createItemPageController }, "Constructor args valid")
            .Assert();
        }
Esempio n. 24
0
        public void Constructor()
        {
            var lrpNavigation     = new Mock <ILrpNavigation>().Object;
            var itemPageViewModel = new Mock <IItemViewModel <Uom> >().Object;
            var itemPage          = new Mock <IItemPage <Uom> >().Object;

            ConstructorTests <ItemPageController <Uom> >
            .For
            (
                typeof(ILrpNavigation),
                typeof(IItemViewModel <Uom>),
                typeof(IItemPage <Uom>)
            )
            .Fail(new object[] { null, itemPageViewModel, itemPage }, typeof(ArgumentNullException), "Null lrpNavigation.")
            .Fail(new object[] { lrpNavigation, null, itemPage }, typeof(ArgumentNullException), "Null itemViewModel")
            .Fail(new object[] { lrpNavigation, itemPageViewModel, null }, typeof(ArgumentNullException), "Null itemPage")
            .Succeed(new object[] { lrpNavigation, itemPageViewModel, itemPage }, "Constructor args valid")
            .Assert();
        }
Esempio n. 25
0
        public void Constructor()
        {
            var connection = new SqliteConnection("DataSource=:memory:");

            try
            {
                using (var context = GetPropertyContext(connection))
                {
                    ConstructorTests <UomWriteRepository>
                    .For(typeof(PropertyContext))
                    .Fail(new object[] { null }, typeof(ArgumentNullException), "Null context")
                    .Succeed(new object[] { context }, "Constructor arguments valid")
                    .Assert();
                }
            }
            finally
            {
                connection.Close();
            }
        }
        public void Constructor()
        {
            var lrpNavigation           = new Mock <ILrpNavigation>().Object;
            var collectionPageViewModel = new Mock <ICollectionPageViewModel <Uom> >().Object;
            var collectionPage          = new Mock <ICollectionPage <Uom> >().Object;
            var itemMvcBuilder          = new Mock <IItemMvcBuilder <Uom> >().Object;

            ConstructorTests <CollectionPageController <Uom> >
            .For
            (
                typeof(ILrpNavigation),
                typeof(ICollectionPageViewModel <Uom>),
                typeof(ICollectionPage <Uom>),
                typeof(IItemMvcBuilder <Uom>)
            )
            .Fail(new object[] { null, collectionPageViewModel, collectionPage, itemMvcBuilder }, typeof(ArgumentNullException), "Null lrpNavigation.")
            .Fail(new object[] { lrpNavigation, null, collectionPage, itemMvcBuilder }, typeof(ArgumentNullException), "Null collectionPageViewModel.")
            .Fail(new object[] { lrpNavigation, collectionPageViewModel, null, itemMvcBuilder }, typeof(ArgumentNullException), "Null collectionPage.")
            .Fail(new object[] { lrpNavigation, collectionPageViewModel, collectionPage, null, }, typeof(ArgumentNullException), "Null itemMvcBuilder.")
            .Succeed(new object[] { lrpNavigation, collectionPageViewModel, collectionPage, itemMvcBuilder }, "Constructor args valid")
            .Assert();
        }
        public void Constructor()
        {
            var mainPage        = new Mock <IMainPage>().Object;
            var jwtTokenManager = new Mock <IJwtTokenManager>().Object;
            var createLoginPage = new Mock <Func <ILoginPage> >().Object;
            var lrpNavigation   = new Mock <ILrpNavigation>().Object;

            ConstructorTests <LoginPageController>
            .For
            (
                typeof(IMainPage),
                typeof(IJwtTokenManager),
                typeof(Func <ILoginPage>),
                typeof(ILrpNavigation)
            )
            .Fail(new object[] { mainPage, jwtTokenManager, createLoginPage, null }, typeof(ArgumentNullException), "Null lrpNavigation.")
            .Fail(new object[] { mainPage, jwtTokenManager, null, lrpNavigation }, typeof(ArgumentNullException), "Null createLoginPage.")
            .Fail(new object[] { mainPage, null, createLoginPage, lrpNavigation }, typeof(ArgumentNullException), "Null jwtTokenManager.")
            .Fail(new object[] { null, jwtTokenManager, createLoginPage, lrpNavigation }, typeof(ArgumentNullException), "Null mainPage.")
            .Succeed(new object[] { mainPage, jwtTokenManager, createLoginPage, lrpNavigation }, "Constructor args valid")
            .Assert();
        }
Esempio n. 28
0
        public void Constructor()
        {
            var mainPage      = new Mock <IMainPage>().Object;
            var viewModel     = new Mock <IMainPageViewModel>().Object;
            var lrpNavigation = new Mock <ILrpNavigation>().Object;
            var uomMvcBuilder = new Mock <ICollectionMvcBuilder <Uom> >().Object;

            ConstructorTests <MainPageController>
            .For
            (
                typeof(IMainPage),
                typeof(IMainPageViewModel),
                typeof(ILrpNavigation),
                typeof(ICollectionMvcBuilder <Uom>)
            )
            .Fail(new object[] { null, viewModel, lrpNavigation, uomMvcBuilder }, typeof(ArgumentNullException), "Null mainPage.")
            .Fail(new object[] { mainPage, null, lrpNavigation, uomMvcBuilder }, typeof(ArgumentNullException), "Null viewModel.")
            .Fail(new object[] { mainPage, viewModel, null, uomMvcBuilder }, typeof(ArgumentNullException), "Null lrpNavigation.")
            .Fail(new object[] { mainPage, viewModel, lrpNavigation, null }, typeof(ArgumentNullException), "Null uomMvcBuilder.")
            .Succeed(new object[] { mainPage, viewModel, lrpNavigation, uomMvcBuilder }, "Constructor args valid")
            .Assert();
        }