public void OperatorKw_As() { //ARRANGE BusinessCustomer cust = new BusinessCustomer { Name = "Stefan", BusinessTel = "+4498347" }; Customer customer = new Customer(); //ACT Customer bcCastAble = cust as Customer; PrivateCustomer custNotCastAble = customer as PrivateCustomer; //ASSERT - Versucht eine Instanz zu Casten. Ist null im Fehlerfall. (Besonderheit: Es wird keine Exception geworfen) bcCastAble.Should().NotBeNull("BusinessCustomer should be castable to Customer"); custNotCastAble.Should().BeNull("Customer can not be casted to PrivateCustomer but the other way round"); }