Example #1
0
            public void ShouldNotBeEmpty()
            {
                var page   = new Page();
                var result = page.ToJson();

                Assert.IsNotEmpty(result);
            }
Example #2
0
            public void ShouldImportBlocks()
            {
                var obj = new
                {
                    IsSystem    = false,
                    Path        = "Test Path",
                    Name        = "Test Name",
                    Description = "Test desc",
                    Blocks      = new List <dynamic>
                    {
                        new
                        {
                            IsSystem            = true,
                            BlockTypeId         = 1,
                            Zone                = "TestZone",
                            Order               = 3,
                            Name                = "FooInstance",
                            OutputCacheDuration = 0
                        }
                    }
                };

                var json      = obj.ToJson();
                var blockType = BlockType.FromJson(json);
                var blocks    = blockType.Blocks;

                Assert.IsNotNull(blocks);
                Assert.IsNotEmpty(blocks);
                Assert.AreEqual(blocks.First().Name, obj.Blocks[0].Name);
            }
        public void StartServerTest()
        {
            TestInitialize();

            #region Act

            _aserv.StartServer();
            Thread.Sleep(5);
            _clientOne.ConnectToServer();
            Thread.Sleep(5);
            _clientTwo.ConnectToServer();
            Thread.Sleep(5);
            _clientThree.ConnectToServer();
            Thread.Sleep(5);

            _clientOne.SendResponse("ClientOne");
            Thread.Sleep(5);
            _clientTwo.SendResponse("ClientTwo");
            Thread.Sleep(5);
            _clientThree.SendResponse("ClientThree");

            #endregion

            #region Assert

            Thread.Sleep(5);
            Assert.IsNotNull(_aserv.ServerSocket);
            Assert.IsNotNull(_aserv.ClientSocket);
            Assert.IsNotEmpty(_aserv.MessageList);

            Thread.Sleep(5);
            _aserv.StopServer();

            #endregion
        }
Example #4
0
            public void ShouldNotBeEmpty()
            {
                var device = DeviceAtCCV();
                var result = device.ToJson();

                Assert.IsNotEmpty(result);
            }
Example #5
0
            public void ShouldImportPagesRecursively()
            {
                const string PAGE_NAME = "Child Page";

                var childPage = new Page {
                    InternalName = PAGE_NAME
                };
                var parentPage = new Page {
                    InternalName = "Parent Page"
                };
                var grandparentPage = new Page {
                    InternalName = "Grandparent Page"
                };

                parentPage.Pages.Add(childPage);
                grandparentPage.Pages.Add(parentPage);

                var json       = grandparentPage.ToJson();
                var page       = Page.FromJson(json);
                var childPages = page.Pages.First().Pages;

                Assert.IsNotNull(childPages);
                Assert.IsNotEmpty(childPages);
                Assert.AreEqual(childPages.First().InternalName, PAGE_NAME);
            }
Example #6
0
 public void CourseDataIsSeeded()
 {
     using (var context = new ApplicationDbContext(_options))
     {
         context.Database.EnsureCreated();
         Assert.IsNotEmpty(context.Course.ToList());
     }
 }
        public void DivisionResultIsNotEmpty()
        {
            _firstNum  = 25;
            _secondNum = 5;
            var result = Calc.Division(_firstNum, _secondNum).ToString();

            Assert.IsNotEmpty(result, $"Result of division {_firstNum} and {_secondNum} is not empty");
        }
Example #8
0
        public void bankListOfAccounts_Manipulation_IsSuccessful()
        {
            Bank.CreateAccount("StandardCheckingAccount", Guid.NewGuid());
            Bank.CreateAccount("CorporateInvestmentAccount", Guid.NewGuid());
            Bank.CreateAccount("IndividualInvestmentAccount", Guid.NewGuid());

            Assert.IsNotEmpty(Bank.Accounts);
        }
        public void UiAUtomatorServer_WhenDumpingUi_ShouldGetContentBack()
        {
            _server.Start();
            var ui = _server.DumpUi();

            Assert.IsNotNull(ui);
            Assert.IsNotEmpty(ui);
        }
Example #10
0
            public void ShouldNotBeEmpty()
            {
                var pageContext = new PageContext {
                    Guid = Guid.NewGuid()
                };
                var result = pageContext.ToJson();

                Assert.IsNotEmpty(result);
            }
Example #11
0
        public void GetFermaToken_TokenReceived()
        {
            var config     = CreateConfiguration();
            var c          = CreateContainer(config);
            var restClient = c.Resolve <GetTokenRestClient>();
            var token      = restClient.Execute(new GetToken());

            Assert.IsNotEmpty(token);
        }
Example #12
0
        public void CreateReceipt_IdReceived()
        {
            var config     = CreateConfiguration();
            var c          = CreateContainer(config);
            var restClient = c.Resolve <CreateRecieptRestClient>();
            var receiptId  = restClient.Execute(Factory.CreateReceipt());

            Assert.IsNotEmpty(receiptId);
        }
Example #13
0
            public void ShouldNotBeEmpty()
            {
                var html = new HtmlContent {
                    Content = "Foo"
                };
                var result = html.ToJson();

                Assert.IsNotEmpty(result);
            }
Example #14
0
            public void ShouldNotBeEmpty()
            {
                var block = new Block {
                    Name = "Foo"
                };
                var result = block.ToJson();

                Assert.IsNotEmpty(result);
            }
Example #15
0
            public void ShouldNotBeEmpty()
            {
                var pageRoute = new PageRoute {
                    Guid = Guid.NewGuid()
                };
                dynamic result = pageRoute.ToJson();

                Assert.IsNotEmpty(result);
            }
Example #16
0
            public void ShouldNotBeEmpty()
            {
                var blockType = new BlockType {
                    Name = "some block type"
                };
                var result = blockType.ToJson();

                Assert.IsNotEmpty(result);
            }
Example #17
0
        public async Task Export_Xml()
        {
            TcmbExchangeApi api       = new TcmbExchangeApi();
            var             exportApi = new TcmbExchangeExportApi(api);
            var             response  = await exportApi.ToXmlAsync(new SearchRequest {  });

            Assert.IsNotNull(response);
            Assert.That(response.FileType == Core.Export.ExportFileType.Xml);
            Assert.IsNotEmpty(response.Data);
        }
Example #18
0
        public void ListaAutoresDeLivrosRetornaOK()
        {
            var resultado = "";

            foreach (var item in ListaDeAutores.ListaAutoresDeLivros())
            {
                resultado = item;
            }

            Assert.IsNotEmpty(resultado, "Retornar OK!");
        }
Example #19
0
            public void ShouldCloneObject()
            {
                var blockType = new BlockType();

                blockType.Blocks.Add(new Block());
                var result = blockType.Clone() as BlockType;

                Assert.NotNull(result);
                Assert.NotNull(result.Blocks);
                Assert.IsNotEmpty(result.Blocks);
            }
Example #20
0
            public void ShouldCopyBlocks()
            {
                var page = new Page {
                    Blocks = new List <Block>()
                };

                page.Blocks.Add(new Block());
                var result = page.Clone() as Page;

                Assert.NotNull(result.Blocks);
                Assert.IsNotEmpty(result.Blocks);
            }
Example #21
0
            public void ShouldCopyPageContexts()
            {
                var page = new Page {
                    PageContexts = new List <PageContext>()
                };

                page.PageContexts.Add(new PageContext());
                var result = page.Clone() as Page;

                Assert.NotNull(result.PageContexts);
                Assert.IsNotEmpty(result.PageContexts);
            }
Example #22
0
            public void ShouldCopyPages()
            {
                var children = new List <Page> {
                    new Page()
                };
                var parent = new Page {
                    Pages = children
                };
                var result = parent.Clone() as Page;

                Assert.IsNotEmpty(result.Pages);
            }
Example #23
0
        public void IApiSecretValidation()
        {
            var result = ValidationHandler.ValidateIApiSecret(ApiSecretFaulted);

            Assert.IsFalse(result.Item1);
            Assert.IsNotEmpty(result.Item2);

            var result2 = ValidationHandler.ValidateIApiSecret(ApiSecretCorrect);

            Assert.IsTrue(result2.Item1);
            Assert.IsEmpty(result2.Item2);
        }
Example #24
0
        public void GetStatus_StatusReceived()
        {
            var config     = CreateConfiguration();
            var c          = CreateContainer(config);
            var restClient = c.Resolve <GetReceiptStatusRestClient>();
            var status     = restClient.Execute(new GetReceiptStatus {
                Request = new GetReceiptRequest {
                    ReceiptId = "e47d048d-aa35-48ec-8b73-8c4d77246765"
                }
            });

            Assert.IsNotEmpty(status.StatusName);
        }
        public async Task DiscoverItems()
        {
            Core.Initialize();

            var libVLC = new LibVLC();

            var mp = new MediaPlayer(libVLC)
            {
                Media = new Media(libVLC, "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4",
                                  Media.FromType.FromLocation)
            };

            Assert.True(mp.Play());

            var rendererList = libVLC.RendererList;

            Assert.IsNotEmpty(rendererList);

            var rendererDiscoverer = new RendererDiscoverer(libVLC);
            var rendererItems      = new List <RendererItem>();
            var tcs = new TaskCompletionSource <bool>();

            rendererDiscoverer.ItemAdded += (sender, args) =>
            {
                WriteLine($"New item discovered: {args.RendererItem.Name} of type {args.RendererItem.Type}");
                if (args.RendererItem.CanRenderVideo)
                {
                    WriteLine("Can render video");
                }
                if (args.RendererItem.CanRenderAudio)
                {
                    WriteLine("Can render audio");
                }

                rendererItems.Add(args.RendererItem);

                tcs.SetResult(true);
            };


            Assert.True(rendererDiscoverer.Start());

            await tcs.Task;

            Assert.True(tcs.Task.Result);
            Assert.IsNotEmpty(rendererItems);
            Assert.True(mp.SetRenderer(rendererItems.First()));

            await Task.Delay(10000);
        }
        public void SocialNetworkPost_InputValidNewUser_CreateNewUserWithPost()
        {
            // arrange
            var socialNetwork = new SocialNetwork();

            // act
            socialNetwork.Post("newuser -> hello world");

            // assert
            var newUser = socialNetwork.Users.Single(u => u.Name == "newuser");

            Assert.IsNotEmpty(socialNetwork.Users);
            Assert.AreEqual(newUser.Timeline[0].Message, " hello world");
        }
Example #27
0
            public void ShouldImportBlocks()
            {
                var obj = new Page {
                    InternalName = "Some Page"
                };

                obj.Blocks.Add(new Block {
                    Name = "Some Block"
                });
                var json = obj.ToJson();
                var page = Page.FromJson(json);

                Assert.IsNotNull(page.Blocks);
                Assert.IsNotEmpty(page.Blocks);
                Assert.AreEqual(page.Blocks.First().Name, obj.Blocks.First().Name);
            }
Example #28
0
            public void ShouldImportPageRoutes()
            {
                var obj = new Page {
                    InternalName = "Some Page"
                };

                obj.PageRoutes.Add(new PageRoute {
                    Route = "/some/route"
                });
                var json = obj.ToJson();
                var page = Page.FromJson(json);

                Assert.IsNotNull(page.PageRoutes);
                Assert.IsNotEmpty(page.PageRoutes);
                Assert.AreEqual(page.PageRoutes.First().Route, obj.PageRoutes.First().Route);
            }
Example #29
0
            public void ShouldCopyPagesRecursively()
            {
                var parent     = new Page();
                var child      = new Page();
                var grandchild = new Page();

                parent.Pages = new List <Page> {
                    child
                };
                child.Pages = new List <Page> {
                    grandchild
                };
                var result = parent.Clone() as Page;

                Assert.IsNotEmpty(result.Pages);
                Assert.IsNotEmpty(result.Pages.FirstOrDefault().Pages);
            }
Example #30
0
        public void GetAllCompanies_Should_Return_A_List_Of_Companies()
        {
            // Given
            var companies = new List <Company>()
            {
                new Company()
                {
                    CompanyId = 42,
                    Name      = "Chuck Norris Corp",
                    Sites     = new List <Site>()
                    {
                        new Site()
                        {
                            SiteId     = 404,
                            CompanyKey = 42,
                            Name       = "The Universe",
                            Billings   = new List <Billing>()
                            {
                                new Billing()
                                {
                                    BillingId = 101,
                                    SiteKey   = 404
                                }
                            }
                        }
                    }
                },
                new Company()
                {
                    CompanyId = 222,
                    Name      = "Empty one",
                    Sites     = new List <Site>()
                }
            };

            _companyRepositoryMock.Setup(x => x.GetAllCompanies()).Returns(companies);

            // When
            var result = _companyService.GetAllCompanies().ToList();

            // Then
            Assert.IsNotEmpty(result);
            Assert.AreEqual(2, result.Count);
            Assert.AreEqual(42, result[0].Id);
            Assert.AreEqual(222, result[1].Id);
        }