From 9e83fcb193e2358b21f6caa10b1fc9f6059018b0 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 22 Apr 2021 06:01:58 -0700 Subject: Move Data into API/wix --- .../WixToolsetTest.Data/TupleDefinitionFixture.cs | 135 --------------------- 1 file changed, 135 deletions(-) delete mode 100644 src/test/WixToolsetTest.Data/TupleDefinitionFixture.cs (limited to 'src/test/WixToolsetTest.Data/TupleDefinitionFixture.cs') diff --git a/src/test/WixToolsetTest.Data/TupleDefinitionFixture.cs b/src/test/WixToolsetTest.Data/TupleDefinitionFixture.cs deleted file mode 100644 index cde4a675..00000000 --- a/src/test/WixToolsetTest.Data/TupleDefinitionFixture.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.Data -{ - using WixToolset.Data; - using WixToolset.Data.Symbols; - using Xunit; - - public class SymbolDefinitionFixture - { - [Fact] - public void CanCreateFileSymbol() - { - var symbol = SymbolDefinitions.File.CreateSymbol(); - Assert.IsType(symbol); - Assert.Same(SymbolDefinitions.File, symbol.Definition); - } - - [Fact] - public void CanCreateFileSymbolByName() - { - var symbol = SymbolDefinitions.ByName("File").CreateSymbol(); - Assert.IsType(symbol); - Assert.Same(SymbolDefinitions.File, symbol.Definition); - } - - //[Fact] - //public void CanCreateFileSymbolByType() - //{ - // var symbol = SymbolDefinitions.CreateSymbol(); - // Assert.Same(SymbolDefinitions.File, symbol.Definition); - //} - - [Fact] - public void CanSetComponentFieldInFileSymbolByCasting() - { - var fileSymbol = (FileSymbol)SymbolDefinitions.File.CreateSymbol(); - fileSymbol.ComponentRef = "Foo"; - Assert.Equal("Foo", fileSymbol.ComponentRef); - } - - [Fact] - public void CanCheckNameofField() - { - var fileSymbol = new FileSymbol(); - Assert.Equal("ComponentRef", fileSymbol.Definition.FieldDefinitions[0].Name); - Assert.Null(fileSymbol.Fields[0]); - fileSymbol.ComponentRef = "Foo"; - Assert.Equal("ComponentRef", fileSymbol.Fields[0].Name); - Assert.Same(fileSymbol.Definition.FieldDefinitions[0].Name, fileSymbol.Fields[0].Name); - } - - [Fact] - public void CanSetComponentFieldInFileSymbolByNew() - { - var fileSymbol = new FileSymbol(); - fileSymbol.ComponentRef = "Foo"; - Assert.Equal("Foo", fileSymbol.ComponentRef); - } - - [Fact] - public void CanGetContext() - { - using (new IntermediateFieldContext("bar")) - { - var fileSymbol = new FileSymbol(); - fileSymbol.ComponentRef = "Foo"; - - var field = fileSymbol[FileSymbolFields.ComponentRef]; - Assert.Equal("Foo", field.AsString()); - Assert.Equal("bar", field.Context); - } - } - - [Fact] - public void CanSetInNestedContext() - { - var fileSymbol = new FileSymbol(); - - using (new IntermediateFieldContext("bar")) - { - fileSymbol.ComponentRef = "Foo"; - - var field = fileSymbol[FileSymbolFields.ComponentRef]; - Assert.Equal("Foo", field.AsString()); - Assert.Equal("bar", field.Context); - - using (new IntermediateFieldContext("baz")) - { - fileSymbol.ComponentRef = "Foo2"; - - field = fileSymbol[FileSymbolFields.ComponentRef]; - Assert.Equal("Foo2", field.AsString()); - Assert.Equal("baz", field.Context); - - Assert.Equal("Foo", (string)field.PreviousValue); - Assert.Equal("bar", field.PreviousValue.Context); - } - - fileSymbol.ComponentRef = "Foo3"; - - field = fileSymbol[FileSymbolFields.ComponentRef]; - Assert.Equal("Foo3", field.AsString()); - Assert.Equal("bar", field.Context); - - Assert.Equal("Foo2", (string)field.PreviousValue); - Assert.Equal("baz", field.PreviousValue.Context); - - Assert.Equal("Foo", (string)field.PreviousValue.PreviousValue); - Assert.Equal("bar", field.PreviousValue.PreviousValue.Context); - } - - fileSymbol.ComponentRef = "Foo4"; - - var fieldOutside = fileSymbol[FileSymbolFields.ComponentRef]; - Assert.Equal("Foo4", fieldOutside.AsString()); - Assert.Null(fieldOutside.Context); - } - - //[Fact] - //public void CanSetComponentFieldInFileSymbol() - //{ - // var fileSymbol = SymbolDefinitions.File.CreateSymbol(); - // fileSymbol.Component_ = "Foo"; - // Assert.Equal("Foo", fileSymbol.Component_); - //} - - //[Fact] - //public void CanThrowOnMismatchSymbolType() - //{ - // var e = Assert.Throws(() => SymbolDefinitions.File.CreateSymbol()); - // Assert.Equal("Requested wrong type WixToolset.Data.Symbols.ComponentSymbol, actual type WixToolset.Data.Symbols.FileSymbol", e.Message); - //} - } -} -- cgit v1.2.3-55-g6feb