public void ProjectReferenceQuestion() { var optionValue = new ProjectReference( "ProjPath", new Guid( "76606c7b-5bf1-497c-9b0f-9695a6a8788d" ), "ProjectName", new XElement( "ProjectReference" ) ); var option = new UserQuestionLiteralWithDescriptionOption<ProjectReference>( "A", "Option A", optionValue, "WasNull" ); Assert.That( option.GetQuestionText(), Is.EqualTo( "(A) Option A:\r\nName: ProjectName\r\nKey: 76606c7b-5bf1-497c-9b0f-9695a6a8788d\r\nPath: ProjPath\r\n" ) ); Assert.That( option.GetValue(), Is.EqualTo( optionValue ) ); }
public void PackageQuestion() { var optionValue = new ConfigitPackageReference( "TestPackageId", "1.2.3.4", "net45" ); var option = new UserQuestionLiteralWithDescriptionOption<ConfigitPackageReference>( "A", "Option A", optionValue, "WasNull" ); Assert.That( option.GetQuestionText(), Is.EqualTo( "(A) Option A:\r\nId: TestPackageId\r\nVersion: 1.2.3.4\r\nTargetFramework: net45\r\n\r\n" ) ); Assert.That( option.GetValue(), Is.EqualTo( optionValue ) ); }
public void RawItemQuestion() { var xElement = XElement.Parse( "<Compile Include=\"File.cs\" />" ); var optionValue = new RawItem( xElement ); var option = new UserQuestionLiteralWithDescriptionOption<RawItem>( "A", "Option A", optionValue, "WasNull" ); Assert.That( option.GetQuestionText(), Is.EqualTo( "(A) Option A:\r\n<Compile Include=\"File.cs\" />\r\n" ) ); Assert.That( option.GetValue(), Is.EqualTo( optionValue ) ); }
public void ReferenceQuestion() { var optionValue = new Reference( "Test.Reference.One", false, null, "TestHintPath" ); var option = new UserQuestionLiteralWithDescriptionOption<Reference>( "A", "Option A", optionValue, "WasNull" ); Assert.That( option.GetQuestionText(), Is.EqualTo( "(A) Option A:\r\nTest.Reference.One\r\nHintPath: TestHintPath\r\nSpecificVersion: False\r\n" ) ); Assert.That( option.GetValue(), Is.EqualTo( optionValue ) ); }
public void UserQuestionLiteralWithDescriptionOption_WhenNoKeyThenKeyNotRendered() { var option = new UserQuestionLiteralWithDescriptionOption<string>( "", "Option A (Not Available)", "Item Description", "Not Available" ); Assert.That( option.GetQuestionText(), Is.EqualTo( "Option A (Not Available):\r\nItem Description\r\n" ) ); }
public void UserQuestionLiteralWithDescriptionOption_NullValue() { var option = new UserQuestionLiteralWithDescriptionOption<string>( "A", "Option A", null, "WasNull" ); Assert.That( option.GetQuestionText(), Is.EqualTo( "(A) Option A:\r\nWasNull\r\n" ) ); Assert.That( option.GetValue(), Is.Null ); }