-
Notifications
You must be signed in to change notification settings - Fork 0
/
ObjectAsConstructor.cs
36 lines (33 loc) · 1011 Bytes
/
ObjectAsConstructor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Linq;
using ObjectToTest.Arguments;
using ObjectToTest.Constructors;
using ObjectToTest.Exceptions;
namespace ObjectToTest
{
/**
* @todo #60m/ARCH Need to create Interface/Class diagram that describes the solution on high level
* Ideally this diagram should be put into Docs folder of the repository and referenced in Readme file.
*/
public class ObjectAsConstructor
{
private readonly object _object;
public ObjectAsConstructor(object @object)
{
_object = @object;
}
public override string ToString()
{
try
{
IArguments sharedArguments = new ObjectSharedArguments(_object);
return $"{sharedArguments}" +
$"{_object.ValidConstructor(sharedArguments)}";
}
catch(NoConstructorException ex)
{
return ex.Message;
}
}
}
}