NUnit.Framework.Assert.IsNullOrEmpty(string)

Here are the examples of the csharp api class NUnit.Framework.Assert.IsNullOrEmpty(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

67 Examples 7

1. Example

View license
public static void ShouldBeNullOrEmpty(this string actual)
		{
			Assert.IsNullOrEmpty(actual);
		}

2. Example

View license
[Test]
        public void CanGetPropertyWithDisallowedSet()
        {
            var pansy = Hardener.Harden(new Pansy());
            Assert.IsNullOrEmpty(pansy.Fears);
        }

3. Example

View license
[Test]
		public void GenerateXHTMLForEntry_VariantShowsIfNotHideMinorEntry_ViewDoesntMatter()
		{
		/n ..... /n //View Source file for more details /n }

4. Example

View license
[Test]
        public async Task Test_InitializeCluster()
        {
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = await clusterManager.InitializeClusterAsync("192.168.77.101");

                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }

5. Example

Project: Glass.Mapper
Source File: MiscFixture.cs
View license
[Test]
        public void OrderOfIgnoreIssue2_ConfiguredShouldBeSet_TitleShouldBeIgnored()
        {
            //Assign
            string path = "/sitecore/content/Tests/Misc/FieldConfigOrder";
            string expected = "Hello space";


            var fluentConfig = new SitecoreFluentConfigurationLoader();

            var typeConfig = fluentConfig.Add<FieldOrderOnIgnore>();
            typeConfig.AutoMap();
            typeConfig.Field(x => x.ConfiguredTitle).FieldName("Title");
            typeConfig.Ignore(x => x.Title);

            var context = Context.Create(Utilities.CreateStandardResolver());
            context.Load(fluentConfig);

            var db = Factory.GetDatabase("master");

            var item = db.GetItem(path);

            using (new ItemEditing(item, true))
            {
                item["Title"] = expected;
            }

            var scContext = new SitecoreContext(db);


            //Act
            var instance = scContext.GetItem<FieldOrderOnIgnore>(path);


            //Assert
            Assert.AreEqual(expected, instance.ConfiguredTitle);
            Assert.IsNullOrEmpty(instance.Title);
        }

6. Example

Project: Glass.Mapper
Source File: MiscFixture.cs
View license
[Test]
        public void OrderOfIgnoreIssue1_ConfiguredShouldBeSet_TitleShouldBeIgnored()
        {
            //Assign
            string path = "/sitecore/content/Tests/Misc/FieldConfigOrder";
            string expected = "Hello space";


            var fluentConfig = new SitecoreFluentConfigurationLoader();

            var typeConfig = fluentConfig.Add<FieldOrderOnIgnore>();
            typeConfig.AutoMap();
            typeConfig.Ignore(x => x.Title);
            typeConfig.Field(x => x.ConfiguredTitle).FieldName("Title");

            var context = Context.Create(Utilities.CreateStandardResolver());
            context.Load(fluentConfig);

            var db = Factory.GetDatabase("master");

            var item = db.GetItem(path);

            using (new ItemEditing(item, true))
            {
                item["Title"] = expected;
            }
            
            var scContext = new SitecoreContext(db);


            //Act
            var instance = scContext.GetItem<FieldOrderOnIgnore>(path);
           

            //Assert
            Assert.AreEqual(expected, instance.ConfiguredTitle);
            Assert.IsNullOrEmpty(instance.Title);
        }

7. Example

Project: GEDKeeper
Source File: PathReplacerTests.cs
View license
[Test]
        public void Test_TryReplacePath()
        {
            string newPath;
            Assert.Throws(typeof(ArgumentNullException), () => { newPath = fPathReplacer.TryReplacePath(null); });

            newPath = fPathReplacer.TryReplacePath(@"C:\TEST\x.yyy");
            Assert.IsNullOrEmpty(newPath);
        }

8. Example

View license
[Test]
        public void EmptyConstructor()
        {
            var actual = new UnresolvableObjectException();
            Assert.IsNotNull(actual);
            Assert.IsNullOrEmpty(actual.ObjectName);
        }

9. Example

View license
[Test]
        public void Defect_IDE_1670()
        {
            string commands = @"CreateIdentif/n ..... /n //View Source file for more details /n }

10. Example

View license
[Test]
        public void Defect_IDE_1677()
        {
            string commands = @"CreateIdentifierNode|d:15430.0|d:15290.5
                                CreateIdentifierNode|d:15387.0|d:15217.5
                                CreateIdentifierNode|d:15555.0|d:15123.0";

            GraphController controller = new GraphController(null);
            bool result00 = controller.RunCommands(commands);
            Assert.AreEqual(true, result00);

            VisualNode node;
            node = (VisualNode)controller.GetVisualNode(0x10000001);
            Assert.IsNullOrEmpty(node.ErrorMessage);
            node = (VisualNode)controller.GetVisualNode(0x10000002);
            Assert.IsNullOrEmpty(node.ErrorMessage);
            node = (VisualNode)controller.GetVisualNode(0x10000003);
            Assert.IsNullOrEmpty(node.ErrorMessage);
        }

11. Example

View license
[Test]
        public void FailedRefreshTokenTest()
        {
            Assert.False(client.RefreshToken(state, null, channel.Request));
            // Test the Authorization state.
            Assert.IsNullOrEmpty(state.AccessToken);
        }

12. Example

View license
[Test]
        public void VerifyMigrationAllowed()
        {
            foreach (TestData data in TestCasesMigrationAllowed)
            {
                var filter = new CrossPoolMigrateCanMigrateFilter(data.Item1, data.Item2, WizardMode.Migrate);
                Assert.False(filter.FailureFound, "Did not expect to find failure");
                Assert.IsNullOrEmpty(filter.Reason, "Did not expect failure reason");
            }
        }

13. Example

View license
[Test]
        public void Test_AddNode()
        {
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.AddNode(SecondaryIp);
                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }

14. Example

View license
[Test]
        public void Test_RemoveBucketAsync()
        {
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.RemoveBucketAsync("test").Result;

                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }

15. Example

View license
[Test]
        public void Test_RemoveBucket()
        {
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.RemoveBucket("test1");

                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }

16. Example

View license
[Test]
        public void VerifyMigrationNotAllowedCurrentServer()
        {
            foreach (TestData data in TestCasesMigrationNotAllowedCurrentServer)
            {
                var filter = new CrossPoolMigrateCanMigrateFilter(data.Item1, data.Item2, WizardMode.Migrate);
                Assert.True(filter.FailureFound, "Expected to find failure");
                Assert.IsNullOrEmpty(filter.Reason, "Did not expect failure reason");
            }
        }

17. Example

View license
[Test]
        public void Test_CreateBucket()
        {
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.CreateBucket("test1");
                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }

18. Example

View license
[Test]
        public void Test_Rebalance()
        {
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.Rebalance();
                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }

19. Example

Project: CIAPI.CS
Source File: AuthenticationFixture.cs
View license
[Test]
        public void LoginUsingSessionShouldValidateSession()
        {
            Client rpcClient = BuildRpcClient("LoginUsingSessionShouldValidateSession");

            Assert.That(rpcClient.Session, Is.Not.Null.Or.Empty);

            //This should work
            Client rpcClientUsingSession = BuildUnauthenticatedRpcClient("LoginUsingSessionShouldValidateSession");

            rpcClientUsingSession.LogInUsingSession(UserName, rpcClient.Session);

            Assert.That(rpcClientUsingSession.Session, Is.Not.Null.Or.Empty);

            //After the session has been destroyed, trying to login using it should fail
            rpcClient.LogOut();
            Assert.Throws<ReliableHttpException>(
                () => rpcClientUsingSession.LogInUsingSession(UserName, rpcClient.Session));

            //And there shouldn't be a session
            Assert.IsNullOrEmpty(rpcClientUsingSession.Session);


            // this client is already logged out. should we swallow unauthorized exceptions in the logout methods?
            // rpcClientUsingSession.LogOut();
            rpcClientUsingSession.Dispose();
            rpcClient.Dispose();
        }

20. Example

Project: CIAPI.CS
Source File: AuthenticationFixture.cs
View license
[Test]
        public void LoginUsingSessionShouldValidateSession()
        {
            Client rpcClient = BuildRpcClient();

            Assert.That(rpcClient.Session, Is.Not.Null.Or.Empty);

            //This should work
            Client rpcClientUsingSession = BuildUnauthenticatedRpcClient();

            rpcClientUsingSession.LogInUsingSession(UserName, rpcClient.Session);

            Assert.That(rpcClientUsingSession.Session, Is.Not.Null.Or.Empty);

            //After the session has been destroyed, trying to login using it should fail
            rpcClient.LogOut();
            Assert.Throws<ReliableHttpException>(
                () => rpcClientUsingSession.LogInUsingSession(UserName, rpcClient.Session));

            //And there shouldn't be a session
            Assert.IsNullOrEmpty(rpcClientUsingSession.Session);


            // this client is already logged out. should we swallow unauthorized exceptions in the logout methods?
            // rpcClientUsingSession.LogOut();
            rpcClientUsingSession.Dispose();
            rpcClient.Dispose();
        }

21. Example

Project: Parrot
Source File: AttributeTests.cs
View license
[Test]
        public void ElementWithOutElementDeclarationButWithClassDeclarationCreatesDivElement()
        {
            var document = Parse(".sample-class");
            Assert.IsNullOrEmpty(null, document.Children[0].Name);
            Assert.AreEqual("class", document.Children[0].Attributes[0].Key);
            Assert.IsInstanceOf<StringLiteral>(document.Children[0].Attributes[0].Value);
            Assert.AreEqual("sample-class", (document.Children[0].Attributes[0].Value as StringLiteral).Values[0].Data);
            //Assert.AreEqual(ValueType.StringLiteral, document.Children[0].Attributes[0].ValueType);
        }

22. Example

Project: PDFCreator
Source File: PrintCommandTest.cs
View license
[Test]
        public void PrintCommand_GivenValidPrintOnlyFile_HasCorrectStartInfo()
        {
            var tempFile = TempFileHelper.CreateTempFile("PrintCommand", "test.ini");
            var printerHelper = new PrinterHelper();
            var printCommand = new PrintCommand(tempFile, printerHelper.GetDefaultPrinter(), new FileAssoc());

            var factory = new MockProcessWrapperFactory(true);
            printCommand.ProcessWrapperFactory = factory;

            printCommand.Print();

            Assert.IsTrue(printCommand.Successful);
            Assert.AreEqual(tempFile, factory.LastMock.StartInfo.FileName);
            Assert.IsNullOrEmpty(factory.LastMock.StartInfo.Arguments);
        }

23. Example

View license
[Test]
        public async void LogInFailBecauseOfFilter()
        {
            var handler = new HttpClientHandler
            {
                AllowAutoRedirect = true,
                Credentials = CredentialCache.DefaultNetworkCredentials
            };
            WebApplication.Options.Filter = (identity, request) => false;
            try
            {
                var client = new HttpClient(handler);
                client.BaseAddress = this.BaseAddress;

                var response = await client.GetAsync("/api/test");
                var result = await response.Content.ReadAsAsync<string>();

                Assert.AreEqual(HttpStatusCode.Unauthorized, response.StatusCode, "Http status");
                Assert.IsNullOrEmpty(result, "Username should have been null");
            }
            finally
            {
                WebApplication.Options.Filter = null;
            }
        }

24. Example

View license
[Test]
        public async void LogInFail()
        {
            var handler = new HttpClientHandler
            {
                AllowAutoRedirect = true,
            };

            var client = new HttpClient(handler);
            client.BaseAddress = this.BaseAddress;

            var response = await client.GetAsync("/api/test");
            var result = await response.Content.ReadAsAsync<string>();

            Assert.AreEqual(HttpStatusCode.Unauthorized, response.StatusCode, "Http status");
            Assert.IsNullOrEmpty(result, "Username should have been null");
        }

25. Example

View license
[Test]
		public void FindAudioTrackByRefId_Test_Fields()
		{
			BrightcoveAudioTrack audioTrack = _api.FindAudioTrackByReferenceId(Sample2.ReferenceId, new List<string> { "id", "name", "shortDescription" });

			//the 3 fields we specified should be present
			Assert.IsNotNull(audioTrack);
			
			Assert.AreEqual(Sample2.Name, audioTrack.Name);
			Assert.AreEqual(Sample2.ShortDescription, audioTrack.ShortDescription);

			//other fields should not
			Assert.IsNullOrEmpty(audioTrack.LongDescription);
			Assert.IsNullOrEmpty(audioTrack.LinkUrl);
		}

26. Example

View license
[Test]
		public void ConvertLayoutTreeNodeToConfigNode_DupStringInfoIsDiscardedForFalseDuplicate()
		{
			var duplicateNode = new XmlDocConfigureDlg.LayoutTreeNode { DupString = "1.0", IsDuplicate = true, Label = "A b c D e f" };
			ConfigurableDictionaryNode configNode;
			// SUT
			using (m_migrator.SetTestLogger = new SimpleLogger())
			{
				configNode = m_migrator.ConvertLayoutTreeNodeToConfigNode(duplicateNode);
			}
			Assert.IsFalse(configNode.IsDuplicate, "Node incorrectly marked as a duplicate.");
			Assert.IsNullOrEmpty(configNode.LabelSuffix, "suffix incorrectly migrated");
			Assert.AreEqual("A b c D e f", configNode.Label, "should not have a suffix on ConfigurableDictionaryNode.Label");
		}

27. Example

Project: Prig
Source File: PrigViewModelTest.cs
View license
[Test]
        public void EndCompletedProjectWideProcessProgress_should_report_the_progress_to_statusbar(
            [Values(
                ProjectWideProcesses.PrigAssemblyAdding,
                ProjectWideProcesses.PrigIndirectionSettingsEditing,
                ProjectWideProcesses.PrigAssemblyRemoving,
                ProjectWideProcesses.TestAdapterEnabling,
                ProjectWideProcesses.TestAdapterDisabling)]
            ProjectWideProcesses pwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var include = fixture.Create<string>();

            var vm = new PrigViewModel();
            vm.BeginProjectWideProcessProgress(pwProc);


            // Act
            vm.EndCompletedProjectWideProcessProgress(include);


            // Assert
            var progState = vm.Statusbar.ProgressState.Value;
            Assert.AreEqual(0u, progState.Value);
            Assert.IsNullOrEmpty(progState.Label);
            Assert.IsNotNullOrEmpty(vm.Statusbar.Text.Value);
        }

28. Example

Project: Prig
Source File: PrigViewModelTest.cs
View license
[Test]
        public void EndSkippedMachineWideProcessProgress_should_report_the_progress_to_statusbar(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc,
            [Values(SkippedReasons.AlreadyRegistered, SkippedReasons.CanceledByUser)]
            SkippedReasons reason)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var vm = new PrigViewModel();
            vm.BeginMachineWideProcessProgress(mwProc);

            // Act
            vm.EndSkippedMachineWideProcessProgress(reason);


            // Assert
            var progState = vm.Statusbar.ProgressState.Value;
            Assert.AreEqual(0u, progState.Value);
            Assert.IsNullOrEmpty(progState.Label);
            Assert.IsNotNullOrEmpty(vm.Statusbar.Text.Value);
        }

29. Example

Project: Prig
Source File: PrigViewModelTest.cs
View license
[Test]
        public void EndCompletedMachineWideProcessProgress_should_report_the_progress_to_statusbar(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var vm = new PrigViewModel();
            vm.BeginMachineWideProcessProgress(mwProc);

            // Act
            vm.EndCompletedMachineWideProcessProgress();


            // Assert
            var progState = vm.Statusbar.ProgressState.Value;
            Assert.AreEqual(0u, progState.Value);
            Assert.IsNullOrEmpty(progState.Label);
            Assert.IsNotNullOrEmpty(vm.Statusbar.Text.Value);
        }

30. Example

Project: Prig
Source File: PrigViewModelTest.cs
View license
[Test]
        public void EndSkippedProjectWideProcessProgress_should_report_the_progress_to_statusbar(
            [Values(
                ProjectWideProcesses.PrigAssemblyAdding,
                ProjectWideProcesses.PrigIndirectionSettingsEditing,
                ProjectWideProcesses.PrigAssemblyRemoving,
                ProjectWideProcesses.TestAdapterEnabling,
                ProjectWideProcesses.TestAdapterDisabling)]
            ProjectWideProcesses pwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var include = fixture.Create<string>();

            var vm = new PrigViewModel();
            vm.BeginProjectWideProcessProgress(pwProc);


            // Act
            vm.EndSkippedProjectWideProcessProgress(SkippedReasons.NotRegisteredYet, include);


            // Assert
            var progState = vm.Statusbar.ProgressState.Value;
            Assert.AreEqual(0u, progState.Value);
            Assert.IsNullOrEmpty(progState.Label);
            Assert.IsNotNullOrEmpty(vm.Statusbar.Text.Value);
        }

31. Example

View license
[Test]
        public void Defect_IDE_1365()
        {
            // Error message is not coming on/n ..... /n //View Source file for more details /n }

32. Example

View license
[Test]
        public void Test_RemoveNodeAsync()
        {
            if (SecondaryIp.Equals(PrimaryIp))
            {
                Assert.Ignore();
            }
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.RemoveNodeAsync(SecondaryIp).Result;
                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }

33. Example

View license
[Test]
        public void Test_FailoverNodeAsync()
        {
            if (SecondaryIp.Equals(PrimaryIp))
            {
                Assert.Ignore();
            }
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.FailoverNodeAsync(SecondaryIp).Result;
                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }

34. Example

View license
[Test]
		public void FindAllAudioTracks_Test_Fields()
		{
			_audioTracks = _api.FindAllAudioTracks(1, 0, SortBy.CreationDate, SortOrder.Descending, new List<string> { "id", "name", "shortDescription" });
			Assert.AreEqual(1, _audioTracks.Count);
			BrightcoveAudioTrack audioTrack = _audioTracks.FirstOrDefault();

			if (audioTrack != null)
			{
				//the 3 fields we specified should be present
				Assert.Greater(audioTrack.Id, 0);
				Assert.IsNotNullOrEmpty(audioTrack.Name);
				Assert.IsNotNullOrEmpty(audioTrack.ShortDescription);

				//other fields should not
				Assert.IsNullOrEmpty(audioTrack.LongDescription);
				Assert.IsNullOrEmpty(audioTrack.LinkUrl);
			}
		}

35. Example

View license
[Test]
        public void Test_AddNodeAsync()
        {
            if (SecondaryIp.Equals(PrimaryIp))
            {
                Assert.Ignore();
            }
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.AddNodeAsync(SecondaryIp).Result;
                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }

36. Example

View license
[Test]
		public void FindAllVideos_Test_Fields()
		{
			_videos = _api.FindAllVideos(1, 0, SortBy.CreationDate, SortOrder.Descending, new List<string> { "id", "name", "shortDescription" });
			Assert.AreEqual(1, _videos.Count);
			BrightcoveVideo video = _videos.FirstOrDefault();

			// the 3 fields we specified should be present
			Assert.Greater(video.Id, 0);
			Assert.IsNotNullOrEmpty(video.Name);
			Assert.IsNotNullOrEmpty(video.ShortDescription);

			// other fields should not
			Assert.IsNullOrEmpty(video.LongDescription);
			Assert.IsNullOrEmpty(video.FlvUrl);
		}

37. Example

View license
[Test]
        public void Test_FailoverNode()
        {
            if (SecondaryIp.Equals(PrimaryIp))
            {
                Assert.Ignore();
            }
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.FailoverNode(SecondaryIp);
                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }

38. Example

Project: Cfg-NET
Source File: EmptyLists.cs
View license
[Test]
        public void ShouldBeInitialized() {
            var cfg = new EmptyListCfg();
            Assert.IsNotNull(cfg.Connections);
            Assert.AreEqual(0, cfg.Connections.Count);
            Assert.IsNullOrEmpty(cfg.NullProperty);
            Assert.IsNotNull(cfg.DefaultedProperty);
            Assert.AreEqual("Default", cfg.DefaultedProperty);
        }

39. Example

Project: BetterCMS
Source File: EntityBaseMapTest.cs
View license
[Test]
        public void Should_Apply_ModifiedOn_Field_After_Save()
        {
            // Can be any another entity type.
            var entity = new Category();
            entity.Name = "test name";
            entity.CategoryTree = new CategoryTree();
            entity.CategoryTree.Title = "category tree";
            entity.CategoryTree.Categories = new List<Category>();
            SaveEntityAndRunAssertionsInTransaction(
                entity,
                resultEntity =>
                    {
                        Assert.IsNotNullOrEmpty(resultEntity.ModifiedByUser);
                        Assert.AreNotEqual(default(DateTime), resultEntity.ModifiedOn);
                    },
                entityBeforeSave =>
                    {
                        Assert.IsNullOrEmpty(entityBeforeSave.ModifiedByUser);
                        Assert.AreEqual(default(DateTime), entityBeforeSave.ModifiedOn);
                    },
                entityAfterSave =>
                    {
                        Assert.IsNotNullOrEmpty(entityAfterSave.ModifiedByUser);
                        Assert.AreNotEqual(default(DateTime), entityAfterSave.ModifiedOn);
                    });
        }

40. Example

Project: BetterCMS
Source File: EntityBaseMapTest.cs
View license
[Test]
        public void Should_Apply_CreatedOn_Field_After_Save()
        {
            // Can be any another entity type.
            var entity = new Category();
            entity.Name = "test name";
            entity.CategoryTree = new CategoryTree();
            entity.CategoryTree.Title = "category tree";
            entity.CategoryTree.Categories = new List<Category>();
            SaveEntityAndRunAssertionsInTransaction(
                entity,
                resultEntity =>
                    {
                        Assert.IsNotNullOrEmpty(resultEntity.CreatedByUser);
                        Assert.AreNotEqual(default(DateTime), resultEntity.CreatedOn);
                    },
                entityBeforeSave =>
                    {
                        Assert.IsNullOrEmpty(entityBeforeSave.CreatedByUser);
                        Assert.AreEqual(default(DateTime), entityBeforeSave.CreatedOn);
                    },
                entityAfterSave =>
                    {
                        Assert.IsNotNullOrEmpty(entityAfterSave.CreatedByUser);
                        Assert.AreNotEqual(default(DateTime), entityAfterSave.CreatedOn);
                    });
        }

41. Example

View license
[Test]
        public void Defect_IDE_2239()
        {
            // Steps are metioned in the defe/n ..... /n //View Source file for more details /n }

42. Example

View license
[Test]
        public async void Authenticate_WhenGivenApplicationCredentials_ShouldReturnAccessToken()
        {
            var token = await this.client.Authenticate();

            Console.WriteLine("Access Token: {0}", token.AccessToken);
            Console.WriteLine("Refresh Token: {0}", token.RefreshToken);
            Console.WriteLine("Token Type: {0}", token.TokenType);
            Console.WriteLine("Expires In: {0}s", token.ExpiresIn);

            Assert.IsNotNull(token);
            Assert.IsNotNullOrEmpty(token.AccessToken);
            Assert.IsNullOrEmpty(token.RefreshToken);
        }

43. Example

View license
[Test]
		public void Load_LoadsBasicsAndDetails()
		{
			DictionaryConfigurationModel model;
			usin/n ..... /n //View Source file for more details /n }

44. Example

View license
[Test]
		public void GetCustomFieldsForType_PossibilityListFieldGetsChildren()
		{
			using (new Cus/n ..... /n //View Source file for more details /n }

45. Example

View license
[Test]
        public void Configure_PathHasValue_ConfigHasPathValue()
        {
            //Assign
            var attr = new StubNodeAttribute();
            var config = new NodeConfiguration();
			var propertyInfo = typeof(StubItem).GetProperty("X");
            var path = "some path";
            
            attr.Path = path;

            //Act
            attr.Configure(propertyInfo, config);

            //Assert
            Assert.AreEqual(propertyInfo, config.PropertyInfo);
            Assert.AreEqual(path, config.Path);
            Assert.IsNullOrEmpty(config.Id);
        }

46. Example

View license
[Test]
        public void Configure_IdHasValue_ConfigHasIdValue()
        {
            //Assign
            var attr = new StubNodeAttribute();
            var config = new NodeConfiguration();
			var propertyInfo = typeof(StubItem).GetProperty("X");
            var id = "some id";

            attr.Id = id;

            //Act
            attr.Configure(propertyInfo, config);

            //Assert
            Assert.AreEqual(propertyInfo, config.PropertyInfo);
            Assert.AreEqual(id, config.Id);
            Assert.IsNullOrEmpty(config.Path);
        }

47. Example

Project: Parrot
Source File: ParrotParserTests.cs
View license
[Test]
            public void ElementWithOutElementDeclarationButWithClassDeclarationCreatesDivElement()
            {
                var document = Parse(".sample-class");
                Assert.IsNullOrEmpty(null, document.Children[0].Name);
                Assert.AreEqual("class", document.Children[0].Attributes[0].Key);
                Assert.IsInstanceOf<StringLiteral>(document.Children[0].Attributes[0].Value);
                Assert.AreEqual("sample-class", (document.Children[0].Attributes[0].Value as StringLiteral).Values[0].Data);
                //Assert.AreEqual(ValueType.StringLiteral, document.Children[0].Attributes[0].ValueType);
            }

48. Example

View license
[Test]
        public void Configure_DefaultValues_ConfigContainsDefaults()
        {
            //Assign
            var attr = new StubNodeAttribute();
            var config = new NodeConfiguration();
			var propertyInfo = typeof(StubItem).GetProperty("X");

            //Act
            attr.Configure(propertyInfo, config);

            //Assert
            Assert.AreEqual(propertyInfo, config.PropertyInfo);
            Assert.IsNullOrEmpty(config.Path);
            Assert.IsNullOrEmpty(config.Id);
        }

49. Example

View license
[Test]
        public void Configure_IsLazyIsFalse_ConfigIsLazyIsFalse()
        {
            //Assign
            var attr = new StubQueryAttribute(string.Empty);
            var config = new QueryConfiguration();
			var propertyInfo = typeof(StubItem).GetProperty("X");

            attr.IsLazy = false;

            //Act
            attr.Configure(propertyInfo, config);

            //Assert
            Assert.AreEqual(propertyInfo, config.PropertyInfo);
            Assert.IsFalse(config.IsLazy);
            Assert.IsFalse(config.InferType);
            Assert.IsFalse(config.IsRelative);
            Assert.IsNullOrEmpty(config.Query);
        }

50. Example

Project: CIAPI.CS
Source File: AuthenticationFixture.cs
View license
[Test]
        public void LoginUsingSessionShouldValidateSession()
        {
            var rpcCli/n ..... /n //View Source file for more details /n }