Fixes other unit tests and wrote a few more.
Examine upgrade [TFS Changeset #67959]
This commit is contained in:
Binary file not shown.
@@ -92,6 +92,12 @@
|
||||
<param name="searchParams">The fluent API search.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Examine.Providers.BaseSearchProvider.CreateSearchCriteria">
|
||||
<summary>
|
||||
Creates an instance of SearchCriteria for the provider
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Examine.Providers.BaseSearchProvider.CreateSearchCriteria(Examine.IndexType)">
|
||||
<summary>
|
||||
Creates an instance of SearchCriteria for the provider
|
||||
|
||||
Binary file not shown.
388
umbraco.Test/MacroTest.cs
Normal file
388
umbraco.Test/MacroTest.cs
Normal file
@@ -0,0 +1,388 @@
|
||||
using umbraco.cms.businesslogic.macro;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Xml;
|
||||
|
||||
namespace umbraco.Test
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
///This is a test class for MacroTest and is intended
|
||||
///to contain all MacroTest Unit Tests
|
||||
///</summary>
|
||||
[TestClass()]
|
||||
public class MacroTest
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///A test for MakeNew
|
||||
///</summary>
|
||||
[TestMethod()]
|
||||
public void Macro_Make_New()
|
||||
{
|
||||
var m = Macro.MakeNew(Guid.NewGuid().ToString("N"));
|
||||
Assert.IsTrue(m.Id > 0);
|
||||
Assert.IsInstanceOfType(m, typeof(Macro));
|
||||
|
||||
m.Delete();
|
||||
var isfound = false;
|
||||
try
|
||||
{
|
||||
var asdf = new Macro(m.Id);
|
||||
isfound = true;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
isfound = false;
|
||||
}
|
||||
|
||||
Assert.IsFalse(isfound);
|
||||
}
|
||||
|
||||
|
||||
#region Tests to write
|
||||
///// <summary>
|
||||
/////A test for Macro Constructor
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void MacroConstructorTest()
|
||||
//{
|
||||
// string alias = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// Macro target = new Macro(alias);
|
||||
// Assert.Inconclusive("TODO: Implement code to verify target");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Macro Constructor
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void MacroConstructorTest1()
|
||||
//{
|
||||
// int Id = 0; // TODO: Initialize to an appropriate value
|
||||
// Macro target = new Macro(Id);
|
||||
// Assert.Inconclusive("TODO: Implement code to verify target");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Macro Constructor
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void MacroConstructorTest2()
|
||||
//{
|
||||
// Macro target = new Macro();
|
||||
// Assert.Inconclusive("TODO: Implement code to verify target");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Delete
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void DeleteTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// target.Delete();
|
||||
// Assert.Inconclusive("A method that does not return a value cannot be verified.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for GetAll
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void GetAllTest()
|
||||
//{
|
||||
// Macro[] expected = null; // TODO: Initialize to an appropriate value
|
||||
// Macro[] actual;
|
||||
// actual = Macro.GetAll();
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for GetByAlias
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void GetByAliasTest()
|
||||
//{
|
||||
// string Alias = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// Macro expected = null; // TODO: Initialize to an appropriate value
|
||||
// Macro actual;
|
||||
// actual = Macro.GetByAlias(Alias);
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Import
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void ImportTest()
|
||||
//{
|
||||
// XmlNode n = null; // TODO: Initialize to an appropriate value
|
||||
// Macro expected = null; // TODO: Initialize to an appropriate value
|
||||
// Macro actual;
|
||||
// actual = Macro.Import(n);
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
/////A test for RefreshProperties
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void RefreshPropertiesTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// target.RefreshProperties();
|
||||
// Assert.Inconclusive("A method that does not return a value cannot be verified.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Save
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void SaveTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// target.Save();
|
||||
// Assert.Inconclusive("A method that does not return a value cannot be verified.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for ToXml
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void ToXmlTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// XmlDocument xd = null; // TODO: Initialize to an appropriate value
|
||||
// XmlNode expected = null; // TODO: Initialize to an appropriate value
|
||||
// XmlNode actual;
|
||||
// actual = target.ToXml(xd);
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Alias
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void AliasTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// string expected = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// string actual;
|
||||
// target.Alias = expected;
|
||||
// actual = target.Alias;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Assembly
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void AssemblyTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// string expected = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// string actual;
|
||||
// target.Assembly = expected;
|
||||
// actual = target.Assembly;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for CacheByPage
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void CacheByPageTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// bool expected = false; // TODO: Initialize to an appropriate value
|
||||
// bool actual;
|
||||
// target.CacheByPage = expected;
|
||||
// actual = target.CacheByPage;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for CachePersonalized
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void CachePersonalizedTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// bool expected = false; // TODO: Initialize to an appropriate value
|
||||
// bool actual;
|
||||
// target.CachePersonalized = expected;
|
||||
// actual = target.CachePersonalized;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Id
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void IdTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// int actual;
|
||||
// actual = target.Id;
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Name
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void NameTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// string expected = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// string actual;
|
||||
// target.Name = expected;
|
||||
// actual = target.Name;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Properties
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void PropertiesTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// MacroProperty[] actual;
|
||||
// actual = target.Properties;
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for RefreshRate
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void RefreshRateTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// int expected = 0; // TODO: Initialize to an appropriate value
|
||||
// int actual;
|
||||
// target.RefreshRate = expected;
|
||||
// actual = target.RefreshRate;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for RenderContent
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void RenderContentTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// bool expected = false; // TODO: Initialize to an appropriate value
|
||||
// bool actual;
|
||||
// target.RenderContent = expected;
|
||||
// actual = target.RenderContent;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for ScriptingFile
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void ScriptingFileTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// string expected = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// string actual;
|
||||
// target.ScriptingFile = expected;
|
||||
// actual = target.ScriptingFile;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Type
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void TypeTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// string expected = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// string actual;
|
||||
// target.Type = expected;
|
||||
// actual = target.Type;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for UseInEditor
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void UseInEditorTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// bool expected = false; // TODO: Initialize to an appropriate value
|
||||
// bool actual;
|
||||
// target.UseInEditor = expected;
|
||||
// actual = target.UseInEditor;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Xslt
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void XsltTest()
|
||||
//{
|
||||
// Macro target = new Macro(); // TODO: Initialize to an appropriate value
|
||||
// string expected = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// string actual;
|
||||
// target.Xslt = expected;
|
||||
// actual = target.Xslt;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
//You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
//Use ClassInitialize to run code before running the first test in the class
|
||||
//[ClassInitialize()]
|
||||
//public static void MyClassInitialize(TestContext testContext)
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//Use ClassCleanup to run code after all tests in a class have run
|
||||
//[ClassCleanup()]
|
||||
//public static void MyClassCleanup()
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//Use TestInitialize to run code before running each test
|
||||
//[TestInitialize()]
|
||||
//public void MyTestInitialize()
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//Use TestCleanup to run code after each test has run
|
||||
//[TestCleanup()]
|
||||
//public void MyTestCleanup()
|
||||
//{
|
||||
//}
|
||||
//
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
303
umbraco.Test/StyleSheetTest.cs
Normal file
303
umbraco.Test/StyleSheetTest.cs
Normal file
@@ -0,0 +1,303 @@
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using umbraco.BusinessLogic;
|
||||
using System.Xml;
|
||||
|
||||
namespace umbraco.Test
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
///This is a test class for StyleSheetTest and is intended
|
||||
///to contain all StyleSheetTest Unit Tests
|
||||
///</summary>
|
||||
[TestClass()]
|
||||
public class StyleSheetTest
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///A test for MakeNew
|
||||
///</summary>
|
||||
[TestMethod()]
|
||||
public void StyleSheet_Make_New()
|
||||
{
|
||||
|
||||
var s = StyleSheet.MakeNew(m_User, Guid.NewGuid().ToString("N"), Guid.NewGuid().ToString("N") + ".css", Guid.NewGuid().ToString("N"));
|
||||
Assert.IsTrue(s.Id > 0);
|
||||
Assert.IsInstanceOfType(s, typeof(StyleSheet));
|
||||
|
||||
//now remove it
|
||||
s.delete();
|
||||
Assert.IsFalse(StyleSheet.IsNode(s.Id));
|
||||
|
||||
}
|
||||
|
||||
[TestMethod()]
|
||||
public void StyleSheet_Make_New_AddProperty()
|
||||
{
|
||||
|
||||
var s = StyleSheet.MakeNew(m_User, Guid.NewGuid().ToString("N"), Guid.NewGuid().ToString("N") + ".css", Guid.NewGuid().ToString("N"));
|
||||
Assert.IsTrue(s.Id > 0);
|
||||
Assert.IsInstanceOfType(s, typeof(StyleSheet));
|
||||
|
||||
//add property
|
||||
var p = s.AddProperty(Guid.NewGuid().ToString("N"), m_User);
|
||||
Assert.IsTrue(p.Id > 0);
|
||||
Assert.IsInstanceOfType(p, typeof(StylesheetProperty));
|
||||
|
||||
//now remove it
|
||||
s.delete();
|
||||
Assert.IsFalse(StyleSheet.IsNode(s.Id));
|
||||
|
||||
//make sure the property is gone too
|
||||
Assert.IsFalse(StylesheetProperty.IsNode(p.Id));
|
||||
|
||||
}
|
||||
|
||||
private User m_User = new User(0);
|
||||
|
||||
#region Tests to write
|
||||
///// <summary>
|
||||
/////A test for StyleSheet Constructor
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void StyleSheetConstructorTest()
|
||||
//{
|
||||
// int id = 0; // TODO: Initialize to an appropriate value
|
||||
// bool setupStyleProperties = false; // TODO: Initialize to an appropriate value
|
||||
// bool loadContentFromFile = false; // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id, setupStyleProperties, loadContentFromFile);
|
||||
// Assert.Inconclusive("TODO: Implement code to verify target");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for StyleSheet Constructor
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void StyleSheetConstructorTest1()
|
||||
//{
|
||||
// int id = 0; // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id);
|
||||
// Assert.Inconclusive("TODO: Implement code to verify target");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for StyleSheet Constructor
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void StyleSheetConstructorTest2()
|
||||
//{
|
||||
// Guid id = new Guid(); // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id);
|
||||
// Assert.Inconclusive("TODO: Implement code to verify target");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for AddProperty
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void AddPropertyTest()
|
||||
//{
|
||||
// Guid id = new Guid(); // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id); // TODO: Initialize to an appropriate value
|
||||
// string Alias = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// User u = null; // TODO: Initialize to an appropriate value
|
||||
// StylesheetProperty expected = null; // TODO: Initialize to an appropriate value
|
||||
// StylesheetProperty actual;
|
||||
// actual = target.AddProperty(Alias, u);
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for GetAll
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void GetAllTest()
|
||||
//{
|
||||
// StyleSheet[] expected = null; // TODO: Initialize to an appropriate value
|
||||
// StyleSheet[] actual;
|
||||
// actual = StyleSheet.GetAll();
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for GetByName
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void GetByNameTest()
|
||||
//{
|
||||
// string name = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// StyleSheet expected = null; // TODO: Initialize to an appropriate value
|
||||
// StyleSheet actual;
|
||||
// actual = StyleSheet.GetByName(name);
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for GetStyleSheet
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void GetStyleSheetTest()
|
||||
//{
|
||||
// int id = 0; // TODO: Initialize to an appropriate value
|
||||
// bool setupStyleProperties = false; // TODO: Initialize to an appropriate value
|
||||
// bool loadContentFromFile = false; // TODO: Initialize to an appropriate value
|
||||
// StyleSheet expected = null; // TODO: Initialize to an appropriate value
|
||||
// StyleSheet actual;
|
||||
// actual = StyleSheet.GetStyleSheet(id, setupStyleProperties, loadContentFromFile);
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Import
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void ImportTest()
|
||||
//{
|
||||
// XmlNode n = null; // TODO: Initialize to an appropriate value
|
||||
// User u = null; // TODO: Initialize to an appropriate value
|
||||
// StyleSheet expected = null; // TODO: Initialize to an appropriate value
|
||||
// StyleSheet actual;
|
||||
// actual = StyleSheet.Import(n, u);
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
/////A test for Save
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void SaveTest()
|
||||
//{
|
||||
// Guid id = new Guid(); // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id); // TODO: Initialize to an appropriate value
|
||||
// target.Save();
|
||||
// Assert.Inconclusive("A method that does not return a value cannot be verified.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for ToXml
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void ToXmlTest()
|
||||
//{
|
||||
// Guid id = new Guid(); // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id); // TODO: Initialize to an appropriate value
|
||||
// XmlDocument xd = null; // TODO: Initialize to an appropriate value
|
||||
// XmlNode expected = null; // TODO: Initialize to an appropriate value
|
||||
// XmlNode actual;
|
||||
// actual = target.ToXml(xd);
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for delete
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void deleteTest()
|
||||
//{
|
||||
// Guid id = new Guid(); // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id); // TODO: Initialize to an appropriate value
|
||||
// target.delete();
|
||||
// Assert.Inconclusive("A method that does not return a value cannot be verified.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for saveCssToFile
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void saveCssToFileTest()
|
||||
//{
|
||||
// Guid id = new Guid(); // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id); // TODO: Initialize to an appropriate value
|
||||
// target.saveCssToFile();
|
||||
// Assert.Inconclusive("A method that does not return a value cannot be verified.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Content
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void ContentTest()
|
||||
//{
|
||||
// Guid id = new Guid(); // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id); // TODO: Initialize to an appropriate value
|
||||
// string expected = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// string actual;
|
||||
// target.Content = expected;
|
||||
// actual = target.Content;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Filename
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void FilenameTest()
|
||||
//{
|
||||
// Guid id = new Guid(); // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id); // TODO: Initialize to an appropriate value
|
||||
// string expected = string.Empty; // TODO: Initialize to an appropriate value
|
||||
// string actual;
|
||||
// target.Filename = expected;
|
||||
// actual = target.Filename;
|
||||
// Assert.AreEqual(expected, actual);
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////A test for Properties
|
||||
/////</summary>
|
||||
//[TestMethod()]
|
||||
//public void PropertiesTest()
|
||||
//{
|
||||
// Guid id = new Guid(); // TODO: Initialize to an appropriate value
|
||||
// StyleSheet target = new StyleSheet(id); // TODO: Initialize to an appropriate value
|
||||
// StylesheetProperty[] actual;
|
||||
// actual = target.Properties;
|
||||
// Assert.Inconclusive("Verify the correctness of this test method.");
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
//You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
//Use ClassInitialize to run code before running the first test in the class
|
||||
//[ClassInitialize()]
|
||||
//public static void MyClassInitialize(TestContext testContext)
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//Use ClassCleanup to run code after all tests in a class have run
|
||||
//[ClassCleanup()]
|
||||
//public static void MyClassCleanup()
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//Use TestInitialize to run code before running each test
|
||||
//[TestInitialize()]
|
||||
//public void MyTestInitialize()
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//Use TestCleanup to run code after each test has run
|
||||
//[TestCleanup()]
|
||||
//public void MyTestCleanup()
|
||||
//{
|
||||
//}
|
||||
//
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,7 @@ namespace umbraco.Test
|
||||
var user = User.GetUser(id);
|
||||
Assert.AreEqual(id, user.Id);
|
||||
|
||||
//System.Diagnostics.Debugger.Launch();
|
||||
user.delete();
|
||||
|
||||
var stillUser = User.GetUser(id);
|
||||
|
||||
@@ -142,12 +142,14 @@
|
||||
<Compile Include="DocumentTypeTest.cs" />
|
||||
<Compile Include="IOHelperTest.cs" />
|
||||
<Compile Include="LanguageTest.cs" />
|
||||
<Compile Include="MacroTest.cs" />
|
||||
<Compile Include="MediaTest.cs" />
|
||||
<Compile Include="MediaTypeTest.cs" />
|
||||
<Compile Include="MemberTest.cs" />
|
||||
<Compile Include="MemberTypeTest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PropertyTypeTest.cs" />
|
||||
<Compile Include="StyleSheetTest.cs" />
|
||||
<Compile Include="UserTest.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
|
||||
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
|
||||
<RunConfiguration id="16410fcd-85b6-4fef-a71f-6d780e90c0df" name="UMBRACOHUMMER" storage="umbracohummer.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<RunConfiguration id="338122db-6049-471e-b697-cbaf25469edc" name="SHANDEMVAIO Tests" storage="shandemvaio.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</TestList>
|
||||
</TestLists>
|
||||
</TestLists>
|
||||
|
||||
@@ -97,6 +97,10 @@ namespace umbraco.BusinessLogic
|
||||
_usertype = UserType.GetUserType(dr.GetShort("UserType"));
|
||||
_defaultToLiveEditing = dr.GetBoolean("defaultToLiveEditing");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("No User exists with ID " + ID.ToString());
|
||||
}
|
||||
}
|
||||
_isInitialized = true;
|
||||
}
|
||||
|
||||
@@ -378,10 +378,14 @@ namespace umbraco.cms.businesslogic.macro
|
||||
{
|
||||
using (IRecordsReader dr = SqlHelper.ExecuteReader("select id, macroUseInEditor, macroRefreshRate, macroAlias, macroName, macroScriptType, macroScriptAssembly, macroXSLT, macroPython, macroDontRender, macroCacheByPage, macroCachePersonalized from cmsMacro where id = @id", SqlHelper.CreateParameter("@id", _id)))
|
||||
{
|
||||
if(dr.Read())
|
||||
{
|
||||
if (dr.Read())
|
||||
{
|
||||
PopulateMacroInfo(dr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("No macro found for the id specified");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ namespace umbraco.cms.businesslogic.web
|
||||
return StylesheetProperty.MakeNew(Alias, this, u);
|
||||
}
|
||||
|
||||
new public void delete()
|
||||
public override void delete()
|
||||
{
|
||||
DeleteEventArgs e = new DeleteEventArgs();
|
||||
FireBeforeDelete(e);
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace umbraco.cms.businesslogic.web
|
||||
return ssp;
|
||||
}
|
||||
|
||||
new public void delete()
|
||||
public override void delete()
|
||||
{
|
||||
DeleteEventArgs e = new DeleteEventArgs();
|
||||
FireBeforeDelete(e);
|
||||
|
||||
@@ -2018,7 +2018,10 @@
|
||||
<Content Include="config\ExamineSettings.config" />
|
||||
<Content Include="config\ExamineIndex.config" />
|
||||
<Content Include="config\scripting.config" />
|
||||
<None Include="Properties\Settings.settings" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings1.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="umbraco\LiveEditing\LiveEditing.cd" />
|
||||
<Content Include="umbraco\masterpages\umbracoPage.Master" />
|
||||
<Content Include="umbraco\masterpages\umbracoDialog.Master" />
|
||||
|
||||
Reference in New Issue
Block a user