Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3 from awesome-inc/master
Browse files Browse the repository at this point in the history
Update from Origin
  • Loading branch information
wgnf authored Aug 20, 2019
2 parents ad2e49e + 714adb6 commit 3fea9df
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 21 deletions.
16 changes: 8 additions & 8 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
##########################################################
#### WhiteSource "Bolt for Github" configuration file ####
##########################################################

# Configuration #
#---------------#
ws.repo.scan=true
vulnerable.check.run.conclusion.level=success
{
"generalSettings": {
"shouldScanRepo": true
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "success"
}
}
3 changes: 1 addition & 2 deletions NZazu/EventArgs/FieldFocusChangedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using NEdifis.Attributes;

namespace NZazu.EventArgs
{
[ExcludeFromConventions("this is just an event arg class")]
public class FieldFocusChangedEventArgs
public class FieldFocusChangedEventArgs : System.EventArgs
{
public FieldFocusChangedEventArgs(INZazuWpfField newFocusedElement, INZazuWpfField oldFocusedElement = null, INZazuWpfField parentElement = null)
{
Expand Down
13 changes: 11 additions & 2 deletions NZazu/Fields/FieldFactoryExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using NZazu.Contracts;
using NZazu.Contracts.Checks;
Expand All @@ -23,8 +24,16 @@ public static NZazuField ApplySettings(this NZazuField field, FieldDefinition fi

// apply generic settings
var controlSettings = fieldDefinition.Settings.Where(s => control.CanSetProperty(s.Key));
foreach (var setting in controlSettings)
control.SetProperty(setting.Key, setting.Value);

try
{
foreach (var setting in controlSettings)
control.SetProperty(setting.Key, setting.Value);
}
catch (ArgumentException exception)
{
Trace.TraceError($"Following error occured while setting the properties for the field <{field.Key}>: {Environment.NewLine}{exception}");
}

return field;
}
Expand Down
14 changes: 14 additions & 0 deletions NZazu/Fields/NZazuField_Should.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,19 @@ public void Define_Multiple_NullReference_Behaviours()

Assert.DoesNotThrow(() => sut.Dispose());
}

[Test]
[TestCase("Width")]
[TestCase("Height")]
[TestCase("Format")]
public void Handle_Empty_Property_Values(string propertyName)
{
var fieldDefinition = new FieldDefinition { Key = "test" };

fieldDefinition.Settings.Add(propertyName, "");
var field = new NZazuField_With_Description_As_Content_Property(fieldDefinition, ServiceLocator);

Assert.DoesNotThrow(() => field.ApplySettings(fieldDefinition));
}
}
}
5 changes: 2 additions & 3 deletions NZazu/Fields/PropertyExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;

Expand Down Expand Up @@ -93,8 +92,8 @@ private static object GetConvertedValue(string propValue, PropertyInfo propInfo)
}
catch (Exception ex)
{
Trace.TraceError("Could not convert the value \"{0}\" for property type \"{1}\" of prop \"{2}\": {3}", propValue, propInfo?.PropertyType.Name, propInfo?.Name, ex);
return null;
var message = $"Could not convert the value \"{propValue}\" for property type \"{propInfo?.PropertyType.Name}\" of prop \"{propInfo?.Name}\"";
throw new ArgumentException(message, ex);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion NZazu/Fields/ValueChangedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace NZazu.Fields
{
[ExcludeFromConventions("this is a simple DTO")]
internal class ValueChangedEventArgs<T>
internal class ValueChangedEventArgs<T> : System.EventArgs
{
public string StoreKey { get; }
public Guid CtrlGuid { get; }
Expand Down
10 changes: 5 additions & 5 deletions NZazu/packages.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="4.3.1" targetFramework="net452" />
<package id="FluentAssertions" version="5.6.0" targetFramework="net452" />
<package id="Castle.Core" version="4.3.1" targetFramework="net452" developmentDependency="true" />
<package id="FluentAssertions" version="5.6.0" targetFramework="net452" developmentDependency="true" />
<package id="FontAwesome.Sharp" version="5.2.0" targetFramework="net452" />
<package id="GitVersionTask" version="4.0.0" targetFramework="net452" developmentDependency="true" />
<package id="NEdifis" version="0.8.3" targetFramework="net452" />
<package id="NSubstitute" version="4.0.0" targetFramework="net452" />
<package id="NUnit" version="3.11.0" targetFramework="net452" />
<package id="NEdifis" version="0.8.3" targetFramework="net452" developmentDependency="true" />
<package id="NSubstitute" version="4.0.0" targetFramework="net452" developmentDependency="true" />
<package id="NUnit" version="3.11.0" targetFramework="net452" developmentDependency="true" />
<package id="OneClickBuild" version="1.11.7" targetFramework="net452" developmentDependency="true" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net452" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net452" />
Expand Down

0 comments on commit 3fea9df

Please sign in to comment.