Here are the examples of the csharp api NUnit.Framework.Assert.IsNull(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3177 Examples
19
View Source File : NumericPropertyTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Ctor_ShouldNotSetDefaultValue_WhenNull()
{
NumericProperty<int> sut = CreateSut<int>();
replacedert.IsNull(sut.Value);
}
19
View Source File : FileTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Save_ShouldNotSavePatternString_WhenPatternStringIsFalse()
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
XmlElement appender = xmlDoc.CreateElement("appender");
mSut.PatternString = false;
mSut.Save(xmlDoc, appender);
XmlNode fileNode = appender.SelectSingleNode("file");
replacedert.IsNull(fileNode?.Attributes?["type"]);
}
19
View Source File : TypeAttributeTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase(null)]
[TestCase("")]
[TestCase("type=\"\"")]
public void Load_ShouldNotLoadType_RegularCtor(string xml)
{
mSut = new TypeAttribute();
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml($"<appender name=\"ColoredConsoleAppender\" {xml}>\r\n" +
"</appender>");
mSut.Load(xmlDoc.FirstChild);
replacedert.IsNull(mSut.Value);
}
19
View Source File : TypeAttributeTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase(null)]
[TestCase("")]
public void Save_ShouldNotSaveValueToAttribute_WhenValueIsNullOrEmpty(string value)
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
XmlElement appender = xmlDoc.CreateElement("appender");
mSut.Value = value;
mSut.Save(xmlDoc, appender);
replacedert.IsNull(appender.Attributes["type"]);
}
19
View Source File : TypeAttributeTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Value_ShouldBeCorrect_RegularCtor()
{
mSut = new TypeAttribute();
replacedert.IsNull(mSut.Value);
}
19
View Source File : ValueTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase(null)]
[TestCase("")]
[TestCase("value=\"\"")]
public void Load_ShouldNotLoadValue(string xml)
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml($"<appender name=\"ColoredConsoleAppender\" {xml}>\r\n" +
"</appender>");
mSut.Load(xmlDoc.FirstChild);
replacedert.IsNull(mSut.Value);
}
19
View Source File : ValueTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase("value=\"\"")]
[TestCase("")]
public void Load_ShouldMaintainValue_FromCtor(string value)
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml($"<appender name=\"ColoredConsoleAppender\" {value}>\r\n" +
"</appender>");
mSut.Load(xmlDoc.FirstChild);
replacedert.IsNull(mSut.Value);
}
19
View Source File : ValueTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase(null)]
[TestCase("")]
public void Save_ShouldNotSaveValueToAttribute_WhenValueIsNullOrEmpty(string value)
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
XmlElement appender = xmlDoc.CreateElement("appender");
mSut.Value = value;
mSut.Save(xmlDoc, appender);
replacedert.IsNull(appender.Attributes["value"]);
}
19
View Source File : ValueTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Value_ShouldBeCorrect_RegularCtor()
{
replacedert.IsNull(mSut.Value);
}
19
View Source File : CapsDelimiterConverterTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Convert_ShouldConvertNullToNull()
{
replacedert.IsNull(mSut.Convert(null, null, null, null));
}
19
View Source File : LayoutToEnabledConverterTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Convert_ShouldReturnNull_WhenValueIsNotLayoutDescriptor()
{
replacedert.IsNull(mSut.Convert(new object(), null, null, null));
}
19
View Source File : XmlUtilitiesTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void AppendTo_ShouldAppendToParent()
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
XmlNode parent = xmlDoc.CreateElement("parent");
XmlNode child = xmlDoc.CreateElement("child");
//Test sanity check
replacedert.IsNull(parent.FirstChild);
child.AppendTo(parent);
replacedert.AreSame(parent.FirstChild, child);
}
19
View Source File : BackColorTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void SelectedLevel_ShouldBeNull_ByDefault()
{
replacedert.IsNull(mSut.SelectedColor);
}
19
View Source File : CountDirectionTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Save_ShouldNotSaveIfNotHigher()
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
XmlElement parent = xmlDoc.CreateElement("element");
mSut.Save(xmlDoc, parent);
replacedert.IsNull(parent[CountDirectionName]);
}
19
View Source File : DatePatternTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Load_ShouldNotSetValue_WhenAttributeValueDoesNotExist()
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml("<appender>\r\n" +
" <datePattern />\r\n" +
"</appender>");
mSut.Load(xmlDoc.FirstChild);
replacedert.IsNull(mSut.Value);
}
19
View Source File : DatePatternTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Load_ShouldNotSetValue_WhenElementDoesNotExist()
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml("<appender>\r\n" +
"</appender>");
mSut.Load(xmlDoc.FirstChild);
replacedert.IsNull(mSut.Value);
}
19
View Source File : EncodingTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Save_ShouldNotSaveSelectedValue_WhenNotSelected()
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
XmlElement appenderElement = xmlDoc.CreateElement("appender");
mSut.Save(xmlDoc, appenderElement);
replacedert.IsNull(appenderElement.SelectSingleNode("encoding"));
}
19
View Source File : FileTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase(null)]
[TestCase("<file />")]
[TestCase("<file value=\"\" />")]
public void Load_ShouldNotLoadNonExistentFile(string file)
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml("<appender type=\"log4net.Appender.FileAppender\" name=\"file\">\n" +
$" {file}\n" +
"</appender>");
mSut.Load(xmlDoc.FirstChild);
replacedert.IsNull(mSut.FilePath);
}
19
View Source File : FileTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Open_ShouldNotSetFilePath_WhenFileNotChosen()
{
mMessageBoxService.ShowOpenFileDialog(out string _).Returns(a =>
{
a[0] = null;
return false;
});
mSut.Open.Execute(null);
replacedert.IsNull(mSut.FilePath);
}
19
View Source File : FileTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Properties_ShouldBeInitializedCorrectly()
{
replacedert.AreSame(mHistoricalFiles, mSut.HistoricalFiles);
replacedert.IsNull(mSut.FilePath);
replacedert.IsFalse(mSut.PatternString);
replacedert.IsFalse(mSut.Overwrite);
}
19
View Source File : LayoutTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Save_ShouldNotCreateConversionPatternElement_WhenSimple()
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
XmlElement appender = xmlDoc.CreateElement("appender");
mSut.Save(xmlDoc, appender);
replacedert.IsNull(appender[LayoutName][ConversionPatternName]);
}
19
View Source File : AppenderModelTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Name_ShouldBeNull_WhenNodeNameIsNonExistent()
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml("<log4net>" +
"<appender>" +
"</appender>" +
"</log4net>");
AppenderModel sut = new AppenderModel(AppenderDescriptor.Async, xmlDoc.FirstChild.FirstChild, 0);
replacedert.IsNull(sut.Name);
}
19
View Source File : ModelFactoryTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void TryCreate_ShouldReturnUnknownAppender_WhenUnknownAppender()
{
replacedert.AreEqual(ModelCreateResult.UnknownAppender, ModelFactory.TryCreate(mXmlDoc.FirstChild.ChildNodes[6], mXmlDoc.FirstChild, out ModelBase model));
replacedert.IsNull(model);
}
19
View Source File : NumericPropertyTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Save_ShouldNotCreateAndAppendElement_WhenDefault()
{
NumericProperty<int> sut = new NumericProperty<int>("Num Prop:", "numProp", 1234) { Value = "1234" };
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
XmlElement appender = xmlDoc.CreateElement("appender");
sut.Save(xmlDoc, appender);
replacedert.IsNull(appender["numProp"]);
}
19
View Source File : NumericPropertyTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Save_ShouldNotCreateAndAppendElement_WhenValueIsNull()
{
NumericProperty<int> sut = CreateSut<int>();
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
XmlElement appender = xmlDoc.CreateElement("appender");
sut.Save(xmlDoc, appender);
replacedert.IsNull(appender["numProp"]);
}
19
View Source File : NameTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase("name=\"\"")]
[TestCase("")]
public void Load_ShouldNotLoadName(string name)
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml($"<appender {name} type=\"log4net.Appender.ColoredConsoleAppender\">\r\n" +
"</appender>");
mSut.Load(xmlDoc.FirstChild);
replacedert.IsNull(mSut.Value);
}
19
View Source File : NameTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Changed_ShouldBeNull_WhenNoOriginalNameExists()
{
mAppenderConfiguration.OriginalNode.Returns((XmlNode)null);
replacedert.IsNull(mSut.Changed);
}
19
View Source File : NameTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void OriginalName_ShouldBeNull_WhenNoOriginalNameAttrExists()
{
mAppenderConfiguration.OriginalNode.Attributes.RemoveNamedItem("name");
replacedert.IsNull(mSut.OriginalName);
}
19
View Source File : NameTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void OriginalName_ShouldBeNull_WhenNoOriginalNodeExists()
{
mAppenderConfiguration.OriginalNode.Returns((XmlNode)null);
replacedert.IsNull(mSut.OriginalName);
}
19
View Source File : RenderedClassTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase("renderedClreplaced=\"\"")]
[TestCase("")]
public void Load_ShouldNotLoadRenderedClreplaced(string renderedClreplaced)
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml($"<renderer {renderedClreplaced}>\r\n" +
"</renderer>");
mSut.Load(xmlDoc.FirstChild);
replacedert.IsNull(mSut.Value);
}
19
View Source File : RenderingClassTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase("renderingClreplaced=\"\"")]
[TestCase("")]
public void Load_ShouldNotLoadRenderingClreplaced(string renderingClreplaced)
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml($"<renderer {renderingClreplaced}>\r\n" +
"</renderer>");
mSut.Load(xmlDoc.FirstChild);
replacedert.IsNull(mSut.Value);
}
19
View Source File : FilterDescriptorTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase(null)]
[TestCase("")]
[TestCase("whatev")]
public void TryFindByTypeNamespace_ShouldReturnFalse_AndNull_ForInvalidTypeNamespace(string typeNamespace)
{
replacedert.IsFalse(FilterDescriptor.TryFindByTypeNamespace(typeNamespace, out FilterDescriptor descriptor));
replacedert.IsNull(descriptor);
}
19
View Source File : AppenderModelTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void TryCreate_ShouldReturnNull_ForUnknownAppenders()
{
XmlDoreplacedent xmlDoc = new XmlDoreplacedent();
xmlDoc.LoadXml("<log4net>" +
"<appender>" +
"</appender>" +
"</log4net>");
AppenderModel.TryCreate(xmlDoc.FirstChild.FirstChild, xmlDoc.FirstChild, out AppenderModel model);
replacedert.IsNull(model);
}
19
View Source File : FilterModelTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void AcceptOnMatch_ShouldReturnNull_WhenDenyAll()
{
mSut = new FilterModel(FilterDescriptor.DenyAll, null, ShowFilterWindow, Remove, MoveUp, MoveDown);
replacedert.IsNull(mSut.AcceptOnMatch);
}
19
View Source File : ConfigurationXmlTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void ChangingDebug_ShouldSave()
{
mSut.Load();
mSut.Debug = false;
XmlNode log4NetNode = mXmlDoc.DoreplacedentElement;
replacedert.IsNull(log4NetNode.Attributes?[Log4NetXmlConstants.Debug]);
}
19
View Source File : ConfigurationXmlTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void ChangingUpdate_ShouldSave()
{
mSut.Load();
mSut.Update = Update.Merge;
XmlNode log4NetNode = mXmlDoc.DoreplacedentElement;
replacedert.IsNull(log4NetNode.Attributes?[Log4NetXmlConstants.Update]);
}
19
View Source File : ConfigurationXmlTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void ChangingThreshold_ShouldSave()
{
mSut.Load();
mSut.Threshold = Level.All;
XmlNode log4NetNode = mXmlDoc.DoreplacedentElement;
replacedert.IsNull(log4NetNode.Attributes?[Log4NetXmlConstants.Threshold]);
}
19
View Source File : SaveIndicationTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void CreateElementConfigurationFor_ShouldCreateElementConfigWithCorrectProperties_WhenModelIsNull()
{
mSut.Load();
IElementConfiguration elementConfiguration = mSut.CreateElementConfigurationFor(null, AppenderDescriptor.Async.ElementName);
replacedert.IsNull(elementConfiguration.OriginalNode);
replacedert.AreEqual(AppenderDescriptor.Async.ElementName, elementConfiguration.NewNode.Name);
replacedert.AreSame(mSut.ConfigXml, elementConfiguration.ConfigXml);
replacedert.AreSame(mSut.Log4NetNode, elementConfiguration.Log4NetNode);
}
19
View Source File : AppenderDescriptorTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[TestCase(null)]
[TestCase("")]
[TestCase("whatev")]
public void TryFindByTypeNamespace_ShouldReturnFalse_AndNull_ForInvalidTypeNamespace(string typeNamespace)
{
replacedert.IsFalse(AppenderDescriptor.TryFindByTypeNamespace(typeNamespace, out AppenderDescriptor descriptor));
replacedert.IsNull(descriptor);
}
19
View Source File : AppenderModelTest.cs
License : MIT License
Project Creator : alexleen
License : MIT License
Project Creator : alexleen
[Test]
public void Name_ShouldBeNull_WhenNodeIsNull()
{
AppenderModel sut = new AppenderModel(AppenderDescriptor.Async, null, 0);
replacedert.IsNull(sut.Name);
}
19
View Source File : StructureNodeReplacerTests.cs
License : MIT License
Project Creator : AndresTraks
License : MIT License
Project Creator : AndresTraks
[Test]
public void ReplaceRootNode()
{
string path = replacedembly.GetExecutingreplacedembly().Location;
path = Path.GetDirectoryName(path);
var root = new RootFolderDefinition(Path.Combine(path, "CppTestProject"));
var header = new HeaderDefinition("header1.h");
root.AddChild(header);
var @clreplaced = new ClreplacedDefinition("CppClreplaced");
header.AddNode(@clreplaced);
var replacement = new RootFolderDefinition(Path.Combine(path, "CppTestProject2"));
StructureNodeReplacer.Replace(root, replacement);
replacedert.IsNull(root.Parent);
replacedert.AreEqual(0, root.Children.Count);
replacedert.IsNull(replacement.Parent);
replacedert.AreEqual(1, replacement.Children.Count);
replacedert.AreEqual(replacement, header.Parent);
}
19
View Source File : OpenFromArasViewModelTest.cs
License : MIT License
Project Creator : arasplm
License : MIT License
Project Creator : arasplm
[Test]
public void SearchMethodDialogCommandExcecute_ShouldDoNotSetExpectedProperties()
{
//Arange
ISearcher searcher = Subsreplacedute.For<ISearcher>();
IItemSearchView searchView = Subsreplacedute.For<IItemSearchView>();
ItemSearchPresenter itemSearchPresenter = Subsreplacedute.ForPartsOf<ItemSearchPresenter>(searchView, searcher);
itemSearchPresenter.When(x => x.Run(Arg.Any<ItemSearchPresenterArgs>())).DoNotCallBase();
this.dialogFactory.GereplacedemSearchPresenter("Method", "Method").Returns(itemSearchPresenter);
this.projectConfigurationManager.CurrentProjectConfiguraiton.LastSavedSearch.Returns(new Dictionary<string, List<PropertyInfo>>());
ItemSearchPresenterResult searchResult = new ItemSearchPresenterResult()
{
DialogResult = DialogResult.Cancel
};
itemSearchPresenter.Run(Arg.Any<ItemSearchPresenterArgs>()).Returns(searchResult);
//Act
this.openFromArasViewModel.SearchMethodDialogCommand.Execute(null);
//replacedert
replacedert.IsNull(this.openFromArasViewModel.MethodName);
replacedert.IsNull(this.openFromArasViewModel.MethodId);
replacedert.IsNull(this.openFromArasViewModel.MethodConfigId);
replacedert.IsNull(this.openFromArasViewModel.MethodLanguage);
replacedert.IsNull(this.openFromArasViewModel.IdenreplacedyKeyedName);
replacedert.IsNull(this.openFromArasViewModel.IdenreplacedyId);
replacedert.IsNull(this.openFromArasViewModel.MethodComment);
replacedert.IsNull(this.openFromArasViewModel.MethodType);
replacedert.IsNull(this.openFromArasViewModel.MethodCode);
replacedert.IsNull(this.openFromArasViewModel.SelectedTemplate);
}
19
View Source File : OpenFromPackageViewModelTest.cs
License : MIT License
Project Creator : arasplm
License : MIT License
Project Creator : arasplm
[Test]
public void FolderBrowserCommand_ShouldLeaveNullAndEmpty()
{
//Arrange
var adapter = new OpenFromPackageTreeViewAdapterTest(false, new PackageInfo(string.Empty), string.Empty, string.Empty, string.Empty);
this.dialogFactory.GetOpenFromPackageTreeView(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<string>(), Arg.Any<string>()).Returns(adapter);
//Act
this.openFromPackageViewModel.FolderBrowserCommand.Execute(null);
//replacedert
replacedert.IsNull(this.openFromPackageViewModel.MethodCode);
replacedert.IsNull(this.openFromPackageViewModel.MethodComment);
replacedert.IsNull(this.openFromPackageViewModel.IdenreplacedyId);
replacedert.IsNull(this.openFromPackageViewModel.MethodConfigId);
replacedert.IsNull(this.openFromPackageViewModel.MethodId);
replacedert.IsNull(this.openFromPackageViewModel.MethodLanguage);
replacedert.IsNull(this.openFromPackageViewModel.IdenreplacedyKeyedName);
replacedert.IsNull(this.openFromPackageViewModel.SelectedTemplate);
}
19
View Source File : OpenFromPackageViewModelTest.cs
License : MIT License
Project Creator : arasplm
License : MIT License
Project Creator : arasplm
[Test]
public void FolderBrowserCommand_ShouldFillExpectedProperty()
{
//Arrange
string currentPath = AppDomain.CurrentDomain.BaseDirectory;
string pathToMethodAml = Path.Combine(currentPath, @"Dialogs\ViewModels\TestData\MethodAml\ReturnNullMethodAml.xml");
var adapter = new OpenFromPackageTreeViewAdapterTest(true, new PackageInfo("testPackageName"), "MfFilePath", "searchType", pathToMethodAml);
this.dialogFactory.GetOpenFromPackageTreeView(Arg.Is("C:\\"), Arg.Any<string>(), Arg.Any<string>(), Arg.Any<string>()).Returns(adapter);
//Act
this.openFromPackageViewModel.FolderBrowserCommand.Execute(null);
//replacedert
replacedert.AreEqual("\r\nreturn null;", this.openFromPackageViewModel.MethodCode);
replacedert.IsNull(this.openFromPackageViewModel.MethodComment);
replacedert.AreEqual("A73B655731924CD0B027E4F4D5FCC0A9", this.openFromPackageViewModel.IdenreplacedyId);
replacedert.AreEqual("B4D99F186D9F3D6631927A3EB3440F99", this.openFromPackageViewModel.MethodConfigId);
replacedert.AreEqual("B4D99F186D9F3D6631927A3EB3440F99", this.openFromPackageViewModel.MethodId);
replacedert.AreEqual("C#", this.openFromPackageViewModel.MethodLanguage);
replacedert.AreEqual("World", this.openFromPackageViewModel.IdenreplacedyKeyedName);
replacedert.IsNull(this.openFromPackageViewModel.SelectedTemplate);
replacedert.AreEqual("searchType", this.openFromPackageViewModel.SelectedSearchType);
}
19
View Source File : XmlMethodLoaderTest.cs
License : MIT License
Project Creator : arasplm
License : MIT License
Project Creator : arasplm
[Test]
public void LoadMethod_ShouldReturnNull()
{
//Arange
XmlMethodLoader xmlMethodLoader = new XmlMethodLoader();
//Act
XmlMethodInfo loadMethodResult = xmlMethodLoader.LoadMethod("");
//replacedert
replacedert.IsNull(loadMethodResult);
}
19
View Source File : TemplateLoaderTest.cs
License : MIT License
Project Creator : arasplm
License : MIT License
Project Creator : arasplm
[Test]
public void GetTemplateFromCodeString_ShouldReturnNull()
{
//Arange
var currentPath = System.AppDomain.CurrentDomain.BaseDirectory;
var methodConfigPath = Path.Combine(currentPath, @"Templates\TestData\method-config.xml");
templateLoader.Load(methodConfigPath);
string testCode = "//MethodTemplateName=templateName";
//Act
TemplateInfo actualTemplate = templateLoader.GetTemplateFromCodeString(testCode, "testLanguage");
//replacedert
replacedert.IsNull(actualTemplate);
}
19
View Source File : OpenFromArasViewModelTest.cs
License : MIT License
Project Creator : arasplm
License : MIT License
Project Creator : arasplm
[Test]
[Ignore("Should be updated")]
public void SearchMethodDialogCommandExcecute_ShouldSetExpectedPropertyValue()
{
//Arange
ISearcher searcher = Subsreplacedute.For<ISearcher>();
IItemSearchView searchView = Subsreplacedute.For<IItemSearchView>();
ItemSearchPresenter itemSearchPresenter = Subsreplacedute.ForPartsOf<ItemSearchPresenter>(searchView, searcher);
itemSearchPresenter.When(x => x.Run(Arg.Any<ItemSearchPresenterArgs>())).DoNotCallBase();
this.dialogFactory.GereplacedemSearchPresenter("Method", "Method").Returns(itemSearchPresenter);
this.projectConfigurationManager.CurrentProjectConfiguraiton.LastSavedSearch.Returns(new Dictionary<string, List<PropertyInfo>>());
ItemSearchPresenterResult searchResult = new ItemSearchPresenterResult()
{
DialogResult = DialogResult.OK,
ItemType = "Method",
ItemId = "1BF96D4255962F7EA5970426401A841E"
};
itemSearchPresenter.Run(Arg.Any<ItemSearchPresenterArgs>()).Returns(searchResult);
this.serverConnection.When(x => x.CallAction("ApplyItem", Arg.Any<XmlDoreplacedent>(), Arg.Any<XmlDoreplacedent>()))
.Do(callBack =>
{
(callBack[2] as XmlDoreplacedent).Load(Path.Combine(currentPath, @"Dialogs\ViewModels\TestData\TestMethodItem.xml"));
});
//Act
this.openFromArasViewModel.SearchMethodDialogCommand.Execute(null);
//replacedert
replacedert.AreEqual("ReturnNullMethodName", this.openFromArasViewModel.MethodName);
replacedert.AreEqual("1BF96D4255962F7EA5970426401A841E", this.openFromArasViewModel.MethodId);
replacedert.AreEqual("616634B3DC344D51964CD7AD988051D7", this.openFromArasViewModel.MethodConfigId);
replacedert.AreEqual("C#", this.openFromArasViewModel.MethodLanguage);
replacedert.AreEqual("World", this.openFromArasViewModel.IdenreplacedyKeyedName);
replacedert.AreEqual("A73B655731924CD0B027E4F4D5FCC0A9", this.openFromArasViewModel.IdenreplacedyId);
replacedert.IsEmpty(this.openFromArasViewModel.MethodComment);
replacedert.AreEqual("server", this.openFromArasViewModel.MethodType);
replacedert.AreEqual("return null;", this.openFromArasViewModel.MethodCode);
replacedert.IsNull(this.openFromArasViewModel.SelectedTemplate);
replacedert.AreEqual(1, this.projectConfigurationManager.CurrentProjectConfiguraiton.LastSavedSearch.Count);
}
19
View Source File : CreateMethodViewModelTest.cs
License : MIT License
Project Creator : arasplm
License : MIT License
Project Creator : arasplm
[Test]
public void Execute_SelectedIdenreplacedyCommand_LeaveEmptyAndNullProperty()
{
//Arange
IItemSearchView view = Subsreplacedute.For<IItemSearchView>();
ISearcher iSearcher = Subsreplacedute.For<ISearcher>();
ItemSearchPresenterResult searchPresenterResult = new ItemSearchPresenterResult()
{
DialogResult = System.Windows.Forms.DialogResult.Cancel
};
ItemSearchPresenter itemSearchPresenter = Subsreplacedute.ForPartsOf<ItemSearchPresenter>(view, iSearcher);
itemSearchPresenter.When(x => x.Run(Arg.Any<ItemSearchPresenterArgs>())).DoNotCallBase();
itemSearchPresenter.Run(Arg.Any<ItemSearchPresenterArgs>()).Returns(searchPresenterResult);
this.dialogFactory.GereplacedemSearchPresenter("Idenreplacedy", "Idenreplacedy").Returns(itemSearchPresenter);
//Act
this.createMethodViewModel.SelectedIdenreplacedyCommand.Execute(null);
//replacedert
replacedert.IsNull(this.createMethodViewModel.SelectedIdenreplacedyKeyedName);
replacedert.IsNull(this.createMethodViewModel.SelectedIdenreplacedyId);
replacedert.AreEqual(0, this.projectConfiguration.LastSavedSearch.Count);
}
19
View Source File : Bin2DTests.cs
License : MIT License
Project Creator : ArchonInteractive
License : MIT License
Project Creator : ArchonInteractive
[TestCase(0, 8)]
[TestCase(4, 5)]
public void Insert_InsideCell_CorrectCell(int expectedX, int expectedY)
{
var bin = new Bin2D<object>(9, 9, 1, 1);
var val = new object();
bin.Insert(val, GetRectInsideCell(expectedX, expectedY, 1, 1));
for (var x = 0; x < bin.Width; x++)
{
for (var y = 0; y < bin.Height; y++)
{
if (x == expectedX && y == expectedY)
continue;
replacedert.IsNull(bin[x, y]);
}
}
replacedert.IsNotNull(bin[expectedX, expectedY]);
replacedert.IsTrue(bin[expectedX, expectedY].Contains(val));
}
19
View Source File : Bin2DTests.cs
License : MIT License
Project Creator : ArchonInteractive
License : MIT License
Project Creator : ArchonInteractive
[TestCase(-1, 0)]
[TestCase(9, 0)]
[TestCase(0, -1)]
[TestCase(0, 9)]
public void Insert_OutOfBounds_NotAdded(int cellX, int cellY)
{
var bin = new Bin2D<object>(9, 9, 1, 1);
var val = new object();
bin.Insert(val, GetRectInsideCell(cellX, cellY, 1, 1));
for (var x = 0; x < bin.Width; x++)
for (var y = 0; y < bin.Height; y++)
replacedert.IsNull(bin[x, y]);
}
See More Examples