Beispiel #1
0
            public void Success()
            {
                // act
                var request = new FeigRequest();
                var result  = FeigTransferResult.Canceled(request);

                // assert
                Check.That(result.Status).IsEqualTo(FeigTransferStatus.Canceled);
                Check.That(result.Request).IsSameReferenceAs(request);
                Check.That(result.Response).IsNull();

                Check.That(result.ToString())
                .IsEqualTo(
                    "Status: Canceled, Request: { Address: 255, Command: None, Data: <empty> }, Response: { <null> }"
                    );
            }
Beispiel #2
0
            public void Success_With_Response()
            {
                // act
                var request  = new FeigRequest();
                var response = new FeigResponse();
                var result   = FeigTransferResult.Success(request, response);

                // assert
                Check.That(result.Status).IsEqualTo(FeigTransferStatus.Success);
                Check.That(result.Request).IsSameReferenceAs(request);
                Check.That(result.Response).IsSameReferenceAs(response);

                Check.That(result.ToString())
                .IsEqualTo(
                    "Status: Success, Request: { Address: 255, Command: None, Data: <empty> }, Response: { Address: 0, Command: None, Status: OK, Data: <empty> }"
                    );
            }
Beispiel #3
0
 public void Exception_With_NullRequest()
 {
     Check.ThatCode(() => FeigTransferResult.Canceled(null)).Throws <ArgumentNullException>();
 }
Beispiel #4
0
 public void Exception_With_NullResponse()
 {
     Check.ThatCode(() => FeigTransferResult.Success(new FeigRequest(), null))
     .Throws <ArgumentNullException>();
 }
Beispiel #5
0
 public void Exception_With_NullRequest()
 {
     Check.ThatCode(() => FeigTransferResult.UnexpectedResponse(null, new FeigResponse()))
     .Throws <ArgumentNullException>();
 }