replaced ExpectedException with Assert.Throws