public void AddDuplicateVariableToGroupType_Returns_NullVariable() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); Assert.NotNull(profileGroupType.AddVariable(buildPath)); LogAssert.Expect(LogType.Error, "prefix.BuildPath already exists."); Assert.Null(profileGroupType.AddVariable(buildPath)); }
public void AddDuplicateVariableToGroupType_FailsToAddVariable() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); Assert.IsTrue(profileGroupType.AddVariable(buildPath)); LogAssert.Expect(LogType.Error, "prefix.BuildPath already exists."); Assert.IsFalse(profileGroupType.AddVariable(buildPath)); }
public void AddVariableToGroupType_AddsVariable() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType.GroupTypeVariable loadPath = new ProfileGroupType.GroupTypeVariable("LoadPath", "Test Load Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); Assert.IsTrue(profileGroupType.AddVariable(buildPath)); Assert.IsTrue(profileGroupType.AddVariable(loadPath)); Assert.True(profileGroupType.Variables.Count == 2); }
public void AddVariableToGroupType_Returns_ExpectedNotNullVariable() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType.GroupTypeVariable loadPath = new ProfileGroupType.GroupTypeVariable("LoadPath", "Test Load Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); Assert.NotNull(profileGroupType.AddVariable(buildPath)); Assert.NotNull(profileGroupType.AddVariable(loadPath)); Assert.True(profileGroupType.Variables.Count == 2); }
public void CreateValidProfileGroupType_Returns_ValidProfileGroupType() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType.GroupTypeVariable loadPath = new ProfileGroupType.GroupTypeVariable("LoadPath", "Test Load Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); profileGroupType.AddVariable(buildPath); profileGroupType.AddVariable(loadPath); Assert.True(profileGroupType.IsValidGroupType()); }
public void CreateValidProfileGroupType_Returns_ValidProfileGroupType() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType.GroupTypeVariable loadPath = new ProfileGroupType.GroupTypeVariable("LoadPath", "Test Load Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); bool aAdded = profileGroupType.AddVariable(buildPath); bool bAdded = profileGroupType.AddVariable(loadPath); Assert.IsTrue(aAdded && bAdded, "Failed to Add variables"); Assert.True(profileGroupType.IsValidGroupType()); }
public void NonExistentGroupFindGroupType_Returns_Null() { ProfileGroupType nonexistentGroup = new ProfileGroupType("Test"); bool v1Added = nonexistentGroup.AddVariable(new ProfileGroupType.GroupTypeVariable(AddressableAssetSettings.kBuildPath, "Test Build Path")); bool v2Added = nonexistentGroup.AddVariable(new ProfileGroupType.GroupTypeVariable(AddressableAssetSettings.kLoadPath, "Test Load Path")); Assert.IsTrue(v1Added && v2Added, "Failed to add the variables for GroupTypes"); var result = Settings.FindGroupType(nonexistentGroup); Assert.IsNull(result); }
public void DoesContainVariable_Returns_True() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); profileGroupType.AddVariable(buildPath); Assert.True(profileGroupType.ContainsVariable(buildPath)); }
public void GetName_Returns_ExpectedVariableName() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); profileGroupType.AddVariable(buildPath); Assert.AreEqual("prefix.BuildPath", profileGroupType.GetName(buildPath)); }
public void GetPathValuesBySuffix_Returns_ExpectedPathValues() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); profileGroupType.AddVariable(buildPath); Assert.AreEqual("Test Build Path", profileGroupType.GetVariableBySuffix(buildPath.Suffix).Value); }
public void GetName_Returns_ExpectedVariableName() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); bool gtAdded = profileGroupType.AddVariable(buildPath); Assert.IsTrue(gtAdded, $"Failed to add groupType {gtAdded}"); Assert.AreEqual("prefix.BuildPath", profileGroupType.GetName(buildPath)); }
public void GetPathValuesBySuffix_Returns_ExpectedPathValues() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); bool variableAdded = profileGroupType.AddVariable(buildPath); Assert.IsTrue(variableAdded, "Failed to add GroupType variable"); Assert.AreEqual("Test Build Path", profileGroupType.GetVariableBySuffix(buildPath.Suffix).Value); }
public void RemoveVariable_Returns_ExpectedAction() { ProfileGroupType.GroupTypeVariable buildPath = new ProfileGroupType.GroupTypeVariable("BuildPath", "Test Build Path"); ProfileGroupType profileGroupType = new ProfileGroupType("prefix"); profileGroupType.AddVariable(buildPath); profileGroupType.RemoveVariable(buildPath); Assert.True(profileGroupType.Variables.Count == 0); }