Skip to content

Commit

Permalink
Fixes test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Lillo committed Feb 12, 2020
1 parent 0865b43 commit e2b35a9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/Mozilla.IoT.WebThing/Activator/ThingActivator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
Expand Down Expand Up @@ -40,8 +40,11 @@ public void Register<T>(IServiceProvider service) where T : Thing
Register<T>(service, name.Replace("Thing", ""));

var thing = CreateInstance(service, name.Replace("Thing", ""));

_thingType.TryAdd(thing.Name, typeof(T));

if (thing.Name != null)
{
_thingType.TryAdd(thing.Name, typeof(T));
}
}

public void Register<T>(IServiceProvider service, string thing)
Expand Down
14 changes: 12 additions & 2 deletions src/Mozilla.IoT.WebThing/Property.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;

Expand All @@ -20,7 +20,17 @@ public Property(string name, object value, IDictionary<string, object> metadata)
{
}

public new virtual T Value { get; set; }
private T _value;

public new virtual T Value
{
get => _value;
set
{
_value = value;
OnValueChanged();
}
}

internal override Type Type => typeof(T);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Mozilla.IoT.WebThing.Activator;
using Mozilla.IoT.WebThing.Activator;
#if DEBUG
using System.Linq;
using System;
Expand Down Expand Up @@ -295,7 +295,6 @@ public void GetEnumerator_Should_ReturnAllInstance()

private class SampleThing : Thing
{

}
}
}
Expand Down

0 comments on commit e2b35a9

Please sign in to comment.